mysql error - 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 error (
/showthread.php?tid=510482)
mysql error -
Face9000 - 01.05.2014
hello, im using BlueG's mysql plugin (R3

and im getting errors while compiling this:
pawn Код:
new string[180];
mysql_query("SELECT `TotalAccounts` FROM `ServerStats`");
mysql_store_result();
new rows = mysql_num_rows();
mysql_free_result();
format(string, sizeof(string), ">> AccSrv: %s (%d) has registered a new account. (Account ID %d) - Total Registered Playes: %d", pname,playerid,pInfo[playerid][ID],rows);
SCMTA(0xFFFFFFFF, string);
(38

: error 035: argument type mismatch (argument 1)
(389) : error 017: undefined symbol "mysql_store_result"
(390) : error 017: undefined symbol "mysql_num_rows"
(391) : error 017: undefined symbol "mysql_free_result"
Any tip to how resolve it?
Re: mysql error -
Eth - 01.05.2014
Error lines please?
Re: mysql error -
Face9000 - 01.05.2014
388:
pawn Код:
mysql_query("SELECT `TotalAccounts` FROM `ServerStats`");
389:
390:
pawn Код:
new rows = mysql_num_rows();
391:
Re: mysql error -
Eth - 01.05.2014
at the top of your script:
Re: mysql error -
Face9000 - 01.05.2014
Lol, i do already. As i said, i use R38 version and that defines are from R7 as im not wrong..so i need just a way to fit them with the R38 version...
Re: mysql error -
Danyal - 01.05.2014
Try to get rows with
cache_get_row_count();
MY SQL QUERY Has Following Parameters
mysql_query(conhandle, query[], bool:use_cache = true)
Re: mysql error -
Eth - 01.05.2014
Quote:
Originally Posted by Face9000
388:
pawn Код:
mysql_query("SELECT `TotalAccounts` FROM `ServerStats`");
389:
390:
pawn Код:
new rows = mysql_num_rows();
391:
|
pawn Код:
new Query[500];
format(Query, 500, "SELECT `TotalAccounts` FROM `ServerStats`");
mysql_query(Query);
add this instead of:
pawn Код:
mysql_query("SELECT `TotalAccounts` FROM `ServerStats`");
+ you need a new copy of mysql because your current version is very old and don't have the mysql_num_rows or the other thing,
or simply add those to the mysql include:
Код:
native mysql_free_result(MySQL:handle = (MySQL:0));
native mysql_store_result(MySQL:handle = (MySQL:0));
native mysql_num_rows(MySQL:handle = (MySQL:0));
Re: mysql error -
Face9000 - 01.05.2014
I used that natives, now im getting an argument type mismatch only here:
mysql_query("SELECT `TotalAccounts` FROM `ServerStats`");
Re: mysql error -
Eth - 01.05.2014
replace this:
pawn Код:
mysql_query("SELECT `TotalAccounts` FROM `ServerStats`");
with:
pawn Код:
new Query[500];
format(Query, 500, "SELECT `TotalAccounts` FROM `ServerStats`");
mysql_query(Query);
Re: mysql error -
Danyal - 01.05.2014
pawn Код:
//top of the script
new mysqlquery;
//then where you connect database
mysqlquery = mysql_connect(...
// now in the last
mysql_format(mysqlquery, query, sizeof(query), "SELECT `TotalAccounts` FROM `ServerStats`");
mysql_query(mysqlquery, query);