[MYSQL] Problem
#1

Hi guys )
I have problem with that:
Код:
CMD:delete(playerid, params[]) {
	if(isnull(params))
	{
		SendClientMessage(playerid, COLOR_RED, "[ERROR] Use: "CWHITE"/delete [ID]");
		return 1;
	}
	
	new id = strval(params);
	format(query, sizeof(query), "SEELCT `UID` FROM `mapa_shop` WHERE `UID` = '%d'",id);
	mysql_query(query);
	if(!mysql_num_rows())
	{
		format(dstring,sizeof(dstring),"[ERROR] The database does not have a shop with UID:"CWHITE" %d",id);
		SendClientMessage(playerid, COLOR_RED, dstring);
		return 1;
	}
	ReloadShop();
	format(query, sizeof(query), "DELETE FROM `mapa_shop` WHERE `UID` = '%d'",id);
	mysql_query(query);
	return 1;
}
I don't know how to check, if the UID of the shop exists in the database. If not the server shows error. Can you help me ?
Reply


Messages In This Thread
[MYSQL] Problem - by Starve - 28.11.2014, 11:50
Re: [MYSQL] Problem - by Vince - 28.11.2014, 12:29
Re: [MYSQL] Problem - by Starve - 28.11.2014, 12:33

Forum Jump:


Users browsing this thread: 2 Guest(s)