This topic is locked

select and insert

6/26/2017 4:28:36 AM
PHPRunner General questions
J
jackheitzer@gmail.com author

Hi all,
I would like to know if the following is possible:
I'd like to select (with the checkbox) several records in a table and then insert in a certain field the username of the person logged in. Does this make any sense?
Hope you can help,
Best regards,
Jack

Sergey Kornilov admin 6/27/2017
J
jackheitzer@gmail.com author 6/28/2017



Yes, this can be done. See example #3 at https://xlinesoft.com/phprunner/docs/inserting_button.htm#examples


Very nice, thank you for the tip! It works like a shine. However... There is one tiny thing.
After the button is pressed and the fields are updated the page doesn't show the results. A refresh of the page is needed. Would it be possible to add a refresh to the button? Or whatever is needed?
Thanks a lot, I really enjoy working with phprunner!!!
Jack

Sergey Kornilov admin 6/28/2017

Yes, it is possible to refresh the page. You can use Javascript code in ClientAfter event to refresh the page.

location.reload();
J
jackheitzer@gmail.com author 6/29/2017



Yes, it is possible to refresh the page. You can use Javascript code in ClientAfter event to refresh the page.

location.reload();



Super, this also did the trick.
However I found a new problem.
It seems

$sql = "update Invoices set Status='Paid' where InvoiceID=" .$record["InvoiceID"];

doesn't work properly if the listpage is filtered, i.e.

"_list.php?f=%28maand~equals~3%29%28jaar~equals~2017%29#"

or

"_list.php?goto=2"


Do you know what happens and how to work around it?
Thanks!!!
Best regards,
Jack

Sergey Kornilov admin 6/29/2017

You need to figure out what exactly goes wrong with your code. Here is the troubleshooting guide:

https://xlinesoft.com/phprunner/docs/troubleshooting_custom_buttons.htm