SA-MP Forums Archive
Help to convert one line from SQLite to MySQL - 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: Help to convert one line from SQLite to MySQL (/showthread.php?tid=596292)



Help to convert one line from SQLite to MySQL - vassilis - 15.12.2015

PHP Code:
    if(db_num_rows(queryresult) == MAX_HOUSES_PER_PLAYER) return SendClientMessage(playerid0xFF0000"You already have the max amount of houses"); 
How this line could be converted in MySQL?


Re: Help to convert one line from SQLite to MySQL - Sawalha - 15.12.2015

https://sampwiki.blast.hk/wiki/MySQL/R33#cache_get_data

using it in a threaded queries, but first define variables of rows and fields to use them in the function, and then the rows variable will hold the number of rows of the threaded-query.
you can use it in the callback you call in mysql_tquery function.


Re: Help to convert one line from SQLite to MySQL - vassilis - 15.12.2015

PHP Code:
new rowsfields;
cache_get_data(rowsfields); 
I know this function. Should i use it something like this?
PHP Code:
if(rows == MAX_PLAYER_PER_HOUSE 



Re: Help to convert one line from SQLite to MySQL - Sawalha - 15.12.2015

exactly, but as i have told you, you have to use it in the callback that the function mysql_tquery called to store the query results in using cache_get_data