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



mysql - TenTen - 24.08.2015

Код:
forward InitializePlayerObjects(playerid);
public InitializePlayerObjects(playerid)
{
	new Query[160];
PHP код:
line 688 
mysql_format(gConnectionhandle, Query, "SELECT * FROM `PlayerObjects` WHERE `Name` = '%s' LIMIT 10", pName(playerid)); mysql_function_query(gConnectionhandle, Query, true, "OnPlayerObjectsLoad", "d", playerid); }
Код:
C:\Users\TRAFEH\Desktop\SA-MP\filterscripts\lol.pwn(688) : error 035: argument type mismatch (argument 3)



Re: mysql - IstuntmanI - 24.08.2015

Replace
pawn Код:
mysql_format(gConnectionhandle, Query, "SELECT * FROM `PlayerObjects` WHERE `Name` = '%s' LIMIT 10",     pName(playerid));
with
pawn Код:
format(Query, 128, "SELECT * FROM `PlayerObjects` WHERE `Name` = '%s' LIMIT 10", pName(playerid));



Re: mysql - Abagail - 24.08.2015

There is no reason to do that. In-fact, you should use the %e as long as you are using mysql_format(this escapes the string). You forgot the sizeof parameter.

pawn Код:
mysql_format(gConnectionhandle, Query, sizeof(Query) "SELECT * FROM `PlayerObjects` WHERE `Name` = '%e' LIMIT 10",     pName(playerid));



Re: mysql - IstuntmanI - 24.08.2015

There is. I guess format is faster than mysql_format, and there is no need to use %e for player name, because the name can't contain ' or ` characters.


Re: mysql - TenTen - 24.08.2015

Thanks you