mysql tquery
#1

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.
Reply
#2

It is not ""`Name` = '%e'"", but it is "" `Name` = '%s'
Reply
#3

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
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)