mysql_tquery
#1

Hi,

I'am using mysql_tquery in some command i want to do:

update table set money='0'
update table set money='5' WHERE name='xxx'

All i want to do send querie to reset all players in database money, and then set money only for one player. Important that update table set money='0' will be complete first, then update table set money='5' WHERE name='xxx', so if i use mysql_tquery i don't need to worry?
Reply
#2

Worry about what D: the amount of descriptive texts are getting lower and lower for every day that passes.

I'm guessing you mean if you use thread querying. If you're so worried about it, then create a function that will occur -after- you reset everyone's money.

mysql_tquery(connection, query, "Function_That_Is_Called_After_This_Is_Done", "i", some_integer_parameter)
Reply
#3

tqueries are executed in the order they were sent, they appear in some sort of query-list.
The first one is executed and will be finished first before the second one is executed and so forth.

If you write it like you specified, it will work that way (reset everything first, then set the money for one specific player).

If you were to use pqueries (parallel queries), you don't have a guarantee which query is finished first.

You can always create a test-table, work out some actions on paper and predict the outcome, then write a small script to test it and check the results.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)