Mysql problem - 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 problem (
/showthread.php?tid=574013)
Mysql problem -
TiXz0r - 12.05.2015
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:
Re: Mysql problem -
bgedition - 12.05.2015
Try:
Код:
mysql_query([your mysql connection],Query);
Re: Mysql problem -
X337 - 12.05.2015
First argument is for connection handle.
Код:
mysql_query(Your Connection handle, Query);
Re: Mysql problem -
TiXz0r - 12.05.2015
Like this?
Код:
mysql_query(1, Query);
Re: Mysql problem -
Konstantinos - 12.05.2015
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.
Re: Mysql problem -
X337 - 12.05.2015
Removed
Re: Mysql problem -
TiXz0r - 12.05.2015
Thanks all