Two queries in one
#7

Quote:
Originally Posted by MP2
Посмотреть сообщение
I want to take action when both queries have been processed. If I use two queries, I cannot assume they will be completed in the order I send them. I need both queries to be complete, and THEN take action. Yes, I could have two variables for each query being completed, but why do that when I can do this?

Also, it's got to be more efficient than sending two separate queries, as there is no result to process.
Doesn't mysql_tquery execute the queries with order but mysql_pquery doesn't? If it doesn't, transactions do:

pawn Код:
mysql_tquery(mysql, "START TRANSACTION;", "");
mysql_tquery(mysql, "UPDATE players ... ;", "");
mysql_tquery(mysql, "DELETE FROM players ... ;", "");
mysql_tquery(mysql, "COMMIT;", "CommitFinished", "");
Just an example. Of course you have them formatted and when CommitFinished will be called, take your action.
Reply


Messages In This Thread
Two queries in one - by MP2 - 23.05.2015, 17:42
Re: Two queries in one - by Stev - 23.05.2015, 17:48
Re: Two queries in one - by Konstantinos - 23.05.2015, 17:49
Re: Two queries in one - by MP2 - 23.05.2015, 17:51
Re: Two queries in one - by Sithis - 23.05.2015, 17:58
Re: Two queries in one - by MP2 - 23.05.2015, 17:59
Re: Two queries in one - by Konstantinos - 23.05.2015, 18:53
Re: Two queries in one - by Sithis - 24.05.2015, 10:24
Re: Two queries in one - by Yashas - 24.05.2015, 10:33
Re: Two queries in one - by Konstantinos - 24.05.2015, 10:42

Forum Jump:


Users browsing this thread: 1 Guest(s)