Best Method for MySQL wait

Creating desktop or client-server database solutions?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
newpie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 155
Joined: Sat Jun 29, 2013 11:24 pm

Best Method for MySQL wait

Post by newpie » Thu Feb 25, 2016 4:25 am

Hello, I have some code in my livecode app which submits data to php for inserting data in the MySQL. The PHP returns "success" when complete and then the script progresses.

The problem I am having is when a large amount of data is being submitted, the livecode script displays my error message as it is too fast, but in reality it is actually being processed/submitted.

1. Is there a method to make livecode wait for the PHP "success" message without making other users wait unnecessarily when they are just submitting small amount of data (like inserting 1 record)?
2. I believe there is a method to also not let the user not make action while the PHP is working.
3. Lastly, It would be great to have a waiting indicator like I have seen on other programs if they are forced to wait a few seconds.

Code: Select all

on submit
 put "VAR="& tvar into tSendData
 liburlsetsslverification false
 post tSendData to URL <address>&"phpScript.php"
 if it is "success" then
...
else
 answer warning "<p align=center> <font face=Marker Felt Wide color=blue size=22> Problem with submission. </font></p>"
exit submit
end submit
Thank you for any assistance.

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 842
Joined: Fri Aug 15, 2008 7:15 am

Re: Best Method for MySQL wait

Post by bangkok » Fri Feb 26, 2016 5:28 pm

newpie wrote:1. Is there a method to make livecode wait for the PHP "success" message
add at the beginning of your script

Code: Select all

   set the socketTimeoutInterval to 30000

newpie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 155
Joined: Sat Jun 29, 2013 11:24 pm

Re: Best Method for MySQL wait

Post by newpie » Tue Mar 01, 2016 2:16 am

Thank you bangkok, I will give this a shot.

Post Reply

Return to “Databases”