SA-MP Forums Archive
MySql errors - 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 errors (/showthread.php?tid=659616)



MySql errors - MarkoKraljina - 09.10.2018

Hello guys, i have a problem when i compile script i get this warnings and error:

modules/sockets.pwn(430) : error 035: argument type mismatch (argument 1)
modules/sockets.pwn(514) : warning 213: tag mismatch
modules/sockets.pwn(533) : warning 213: tag mismatch


Line in script:

430
format(string,sizeof(string),"SELECT * FROM `ns_clients` WHERE `Username` = '%s'",pName[PlayerID]); mysql_tquery(string,true,"NSUpdateQuery","i",Playe rID);

514
mysql_format(SQLConn,query,false,"","");

533
mysql_format(SQLConn,query,false,"","");


Re: MySql errors - v1k1nG - 09.10.2018

Код:
modules/sockets.pwn(430) : error 035: argument type mismatch (argument 1)
Argument 1 is "string". You've maybe created a variable called string, but to format it, you need to define its lenght, example:
PHP код:
new string[128]; 
Now you can format the string.

mysql_format has several arguments:
PHP код:
// formatting an example string
mysql_format(databasestringsizeof(string), "INSERT INTO `databasename` (`kills`) VALUES ('%d')",playerInfo[playerid][Kills] );