2 mysql queries at once?
#1

So i am using SA-MP-MySQL R41-4, and when a player registers a new account, a query for adding a new row in the table of users is made by mysql_tquery function. Recently i added a system of inventory on my server, and now i need 2 queries for creating a row in the users table and in the inventories table to be executed at once, but it's impossible to do that in mysql_tquery function (i've tried separating them by ';', i get syntax errors in the mysql log). The only idea that i've got so far is to make "chain" of tquery'ies so that it first inserts a new row into talbe `users`, then in the callback of that tquery it inserts a new row into `inventories` table etc., but that's ultra ugly code, and there must be a much better way to solve my problem. So what can i do?
Reply


Messages In This Thread
2 mysql queries at once? - by 0xAAAAAA - 16.09.2018, 10:53
Re: 2 mysql queries at once? - by ShihabSoft - 17.09.2018, 06:17
Re: 2 mysql queries at once? - by iLearner - 17.09.2018, 06:40
Re: 2 mysql queries at once? - by 0xAAAAAA - 17.09.2018, 08:08
Re: 2 mysql queries at once? - by AmirSavand - 17.09.2018, 08:31
Re: 2 mysql queries at once? - by Calisthenics - 17.09.2018, 08:44

Forum Jump:


Users browsing this thread: 1 Guest(s)