mysql_real_escape_string
#1

Hello, I work to a commnad that applied only for offline users, i have something like this:
Код:
CMD:auninviteoff(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
	if(PlayerInfo[playerid][pAdmin] >= 4)
	{
		new id, fp, reason, string[MAX_STRING];
		if(sscanf(params, "s[30]is[64]", id, fp, reason)) return SCM(playerid, -1, "Usage: /auninviteoff [name] [fp] [reason]");
		mysql_real_escape_string(id, escape);
		mysql_format(SQL, string, sizeof string, "SELECT * FROM `users` WHERE `name` = '%s'", escape);
		mysql_tquery(SQL, string, "doUninviteAdminOff", "dsds", playerid, id, fp, reason);
	}
	return 1;
}
But i don't know if i need to use mysql_real_escape_string(id, escape); if i already call the function using mysql_tquery. Or to use in the function
Код:
function doUninviteAdminOff(playerid, id, fp, reason[]) { mysql_real_escape_string(id, escape); }
Basically, the commnad i used to change didn't call any function it was just a command and now I want to call a function to be more quickly when I use this function from somewhere else.

If someone can help, please post here.
Reply


Messages In This Thread
mysql_real_escape_string - by RedGun2015 - 24.10.2017, 15:54
Re: mysql_real_escape_string - by Abagail - 24.10.2017, 15:56
Re: mysql_real_escape_string - by RedGun2015 - 25.10.2017, 11:53
Re: mysql_real_escape_string - by CodeStyle175 - 25.10.2017, 14:35

Forum Jump:


Users browsing this thread: 1 Guest(s)