Mysql problem
#1

Hello.

I have problem with mysql.

Part of script:

Код:
                     new Query[124];
                     format(Query, sizeof(Query), "INSERT INTO `lista_reganih` (`Name`, `DatumREG`) VALUES('%s',                  '%s')", GetName(playerid), datetime);
                     mysql_query(Query);
error:

Код:
error 035: argument type mismatch (argument 1)
error is on line:

Код:
mysql_query(Query);
Reply
#2

Try:
Код:
mysql_query([your mysql connection],Query);
Reply
#3

First argument is for connection handle.
Код:
mysql_query(Your Connection handle, Query);
Reply
#4

Like this?


Код:
mysql_query(1, Query);
Reply
#5

The output is 1 by default but using multiply connections could cause an issue.

pawn Код:
// global:
static gMySQL = -1;

// gamemode init:
gMySQL = mysql_connect(...);

// gamemode exit:
mysql_close(gMySQL);

...

mysql_query(gMySQL, query);
However, I strongly recommend you to use threaded queries and R39-3 because non-threaded queries are still slower.
Reply
#6

Removed
Reply
#7

Thanks all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)