mySQL command isn't working.
#1

Code:
CMD:loopserial(playerid, params[])
{
	if(!PlayerInfo[playerid][pAdmin]) return SCM(playerid, RED, "Not authorized");
	new query[128], serial[40];
	if(sscanf(params, "s[45]", serial)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /loopserial [Serial IDl]");
	mysql_format(sqlL, query, sizeof(query), "SELECT Name, LastLogged FROM players WHERE Serial = '%e'", serial);
	mysql_pquery(sqlL, query, "GetListSerial", "i", playerid);
	return 1;
}
Code:
forward GetListSerial(playerid);
public GetListSerial(playerid)
{
	if(!PlayerInfo[playerid][pAdmin]) return 1;
	if(cache_num_rows() == 0) return SendClientMessage(playerid, COLOR_WHITE, "I couldn't find any account with the matching SERIAL ID.");
	new serial[10000], lastlog[64], name[MAX_PLAYER_NAME];
	for(new i = 0; i < cache_num_rows(); i++)
	{
		cache_get_field_content(i, "Name", name);
		cache_get_field_content(i, "LastLogin", lastlog);
		format(serial, sizeof(serial), "%s{FFFF00}%s  (%s)\t\t{FFFFFF}\n", serial, name, lastlog);
	}
	ShowPlayerDialog(playerid, NOTEXISTING, DIALOG_STYLE_TABLIST, "Serials IDS", serial, "Okay", "");
	return 1;
}
When I write in game /loopserial [serial which actually exists] it does not work, it says "I couldn't find any account with the matching SERIAL ID".
Help plss
Reply


Messages In This Thread
mySQL command isn't working. - by ShadowMortar - 22.12.2018, 11:21
Re: mySQL command isn't working. - by zerruv - 22.12.2018, 13:37
Re: mySQL command isn't working. - by Calisthenics - 22.12.2018, 13:39
Re: mySQL command isn't working. - by ShadowMortar - 22.12.2018, 13:56
Re: mySQL command isn't working. - by ShadowMortar - 22.12.2018, 19:57

Forum Jump:


Users browsing this thread: 1 Guest(s)