mysql tquery - 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 tquery (
/showthread.php?tid=586584)
mysql tquery -
MartinSwag - 23.08.2015
Why is OnAccountCheck not being called? I don't see the print.
Код:
forward OnAccountCheck(playerid);
public OnPlayerConnect(playerid)
{
SetPlayerColor(playerid, 0x888888FF);
GameTextForPlayer(playerid,"~r~SA-MP: ~w~Rivershell",2000,5);
RemoveNeededBuildingsForPlayer(playerid);
new query[256];
GetPlayerName(playerid, PlayerInfo[playerid][Name], 24);
mysql_format(mysql, query, sizeof(query), "SELECT `Password`, `ID` FROM `accounts` WHERE `Name` = '%e' LIMIT 1", PlayerInfo[playerid][Name]);
mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);
return 1;
}
public OnAccountCheck(playerid)
{
print("Reached onAccountCheck!")
Crashdetect doesn't show anything and the mysql_log looks normal.
Re: mysql tquery -
Belengher - 23.08.2015
It is not ""`Name` = '%e'"", but it is "" `Name` = '%s'
Re: mysql tquery -
MartinSwag - 23.08.2015
Nvm I found it, I'm trying to call OnAccountCheck, but in the actual script I had 'public
onAccountCheck', I'm going to slap myself
Re: mysql tquery -
AndySedeyn - 23.08.2015
Quote:
Originally Posted by Belengher
It is not ""`Name` = '%e'"", but it is "" `Name` = '%s'
|
Using %e is not wrong! %e is better than %s in terms of security. %e is the specifier to escape a string.