mysql error
#1

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?
Reply
#2

Error lines please?
Reply
#3

388:

pawn Код:
mysql_query("SELECT `TotalAccounts` FROM `ServerStats`");
389:

pawn Код:
mysql_store_result();
390:

pawn Код:
new rows = mysql_num_rows();
391:

pawn Код:
mysql_free_result();
Reply
#4

at the top of your script:
pawn Код:
#define <mysql>
Reply
#5

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...
Reply
#6

Try to get rows with

cache_get_row_count();
MY SQL QUERY Has Following Parameters
mysql_query(conhandle, query[], bool:use_cache = true)
Reply
#7

Quote:
Originally Posted by Face9000
Посмотреть сообщение
388:

pawn Код:
mysql_query("SELECT `TotalAccounts` FROM `ServerStats`");
389:

pawn Код:
mysql_store_result();
390:

pawn Код:
new rows = mysql_num_rows();
391:

pawn Код:
mysql_free_result();
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));
Reply
#8

I used that natives, now im getting an argument type mismatch only here:

mysql_query("SELECT `TotalAccounts` FROM `ServerStats`");
Reply
#9

replace this:
pawn Код:
mysql_query("SELECT `TotalAccounts` FROM `ServerStats`");
with:
pawn Код:
new Query[500];
                format(Query, 500, "SELECT `TotalAccounts` FROM `ServerStats`");
                mysql_query(Query);
Reply
#10

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)