[SOLVED] Custom Button Server Event SQL Update where id='$id' |
10/29/2022 4:36:50 AM |
PHPRunner General questions | |
![]() I have made a custom button on a list page for each record that says "Assign Now" When the button is pressed I want it to update a MySQL DB Table row with a "1" in the Assigned field | order_id | Assigned || 1 | NULL | I am using this in the server Event as per The Additional Troubleshooting Tips at https://xlinesoft.com/phprunner/docs/troubleshooting_custom_buttons.htm $result["txt"]=""; The issue is that every button on a row that has a order_id less than 2 charactors (ie. 1 or 2 or 5 or 8) works perfectly well update orders set Assigned='1' where order_id=1
It should say... update orders set Assigned='1' where order_id=15
Can anyone see an error in the Events->Server script from the Troubleshooting Tips page? |
|
![]() |
Admin 10/29/2022 |
I'm not sure I understand your question. Are you asking if someone sees an error in your code or you asking for more troubleshooting tips? |
![]() |
1NET author 10/30/2022 |
The Code listed as a solution @ https://xlinesoft.com/phprunner/docs/troubleshooting_custom_buttons.htm The issue is Other record in the database with an ID that is 1 digit long works perfectly well with this script is there an issue with your code from the above listed forum page? |
![]() |
Admin 10/30/2022 |
https://xlinesoft.com/phprunner/docs/troubleshooting_custom_buttons.htm is an article that provides troubleshooting tips. If you are looking for code examples check this article: Check examples #1 or #2 there. |
![]() |
1NET author 10/30/2022 |
Thanks for your suggestion I've modofoed the code to produce the correct result The Fix Client Before params["txt"] = ""; Server global $dal; Client After var message = result["txt"] + " - COMPLETE!"; Again thanks for your assistance |