MySQL Help! - 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 Help! (
/showthread.php?tid=500969)
MySQL Help! -
iBeast - 15.03.2014
Erm...
I am familiar with BlueG's R38 MySQL plugin to some sufficient extent but I am still unaware of things...
So,
First thing why is cache_num_rows() used ? When there is cache_get_data ?
Second thing and my real question, how do I save the result without a threaded query, for example I want to make a changename command, it needs to be scripted with an unthreaded query so, how do I save the result ?
Re: MySQL Help! -
maddinat0r - 15.03.2014
Quote:
Originally Posted by iBeast
First thing why is cache_num_rows() used ? When there is cache_get_data ?
|
Because people are lazy. 'cache_get_data' gives the number of rows
and fields, but there is often only a need for one of both.
Quote:
Originally Posted by iBeast
Second thing and my real question, how do I save the result without a threaded query, for example I want to make a changename command, it needs to be scripted with an unthreaded query so, how do I save the result ?
|
With 'mysql_query'.
Код:
new query[256];
mysql_format(sql, query, sizeof(query), "UPDATE players SET `username` = '%e' WHERE `id` = '%d'", new_pname, PlayerInfo[playerid][ID]);
mysql_tquery(sql, query); //sends a threaded query
mysql_query(sql, query, false); //sends an unthreaded query
Re: MySQL Help! -
iBeast - 16.03.2014
Thanks, maddinat0r