SA-MP Forums Archive
[MYSQL]How to check if query is succesful? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [MYSQL]How to check if query is succesful? (/showthread.php?tid=536631)



[MYSQL]How to check if query is succesful? - Type-R - 11.09.2014

Hey guys im still translating my script to R39. I'm in my house system right now, and im in the menu where you can change the interior, and just in case the query isn't successful i want to say something to the player. Heres my Tquery:

pawn Код:
mysql_format(mysql, gQuery, sizeof(gQuery),"UPDATE "Houses_Table" SET Price = %i, InteriorID = %i WHERE ID = %i",HouseInfo[hID][Price], HouseInfo[hID][InteriorID], hID);
           mysql_tquery(mysql, gQuery);

What would be a way to check if it was successful?


Re: [MYSQL]How to check if query is succesful? - Lordzy - 11.09.2014

Use the callback parameter from mysql_tquery. If the callback specified hasn't been called when the query is passed, it means the query isn't successful.


Re: [MYSQL]How to check if query is succesful? - Type-R - 11.09.2014

Sorry for me being, an idiot. I know how to use the callback function, but how do i check if the callback function was called?


Re: [MYSQL]How to check if query is succesful? - Vince - 11.09.2014

Use OnQueryError.