SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Thread Tools Display Modes
Old 09/02/2014, 09:52 AM   #1
Join Date: Jan 2013
Posts: 737
Reputation: 0
Default About threaded queries.


If i sent two queries in one time for ex:

mysql_tquery("UPDATE players ....");
mysql_tquery("SELECT * FROM players ... ");
Then the query where is 'Update players' will be first completed? and then other query, 'Select * From players'? But it's possible, due lagg or something, the second query will be finished first, and then first query? it's important for my because, i want to update something, and then load that information, what was updated.
audriuxxx is offline   Reply With Quote
Old 09/02/2014, 10:19 AM   #2
Spam Machine
Vince's Avatar
Join Date: Sep 2007
Location: Belgium
Posts: 10,068
Reputation: 2655
Default Re: About threaded queries.

Yes, they can be executed out of order. This is known as a race condition. Create a callback for the UPDATE query and execute the SELECT there.
Vince is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Removal of un-threaded queries created a problem. GiamPy. Scripting Help 5 01/01/2014 09:48 PM
MySQL Threaded Queries CONTROLA Scripting Help 4 25/11/2012 03:02 PM
Threaded and non threaded queries CoDeZ Scripting Help 3 12/09/2012 01:17 PM
Threaded Queries C0dy09 Scripting Help 3 08/05/2012 01:41 PM
Threaded queries armyoftwo Help Archive 0 11/12/2010 01:49 PM

All times are GMT. The time now is 09:31 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.