Mysql Error
#1

hey guys i have this errors in my mysql_log

Код HTML:
[01:36:35 09/24/16] [ERROR] CMySQLQuery::Execute - (error #1054) Unknown column 'SherifuL' in 'where clause' (Query: "SELECT `ID`, `AdminLevel` FROM `players` WHERE `Name` = SherifuL")
[01:36:35 09/24/16] [WARNING] cache_get_field_content - no active cache
[01:36:35 09/24/16] [WARNING] cache_get_field_content - no active cache
[01:36:35 09/24/16] [WARNING] CMySQLHandle::DeleteSavedResult - invalid result id ('0')
[01:36:35 09/24/16] [ERROR] CMySQLQuery::Execute[] - (error #1054) Unknown column 'SherifuL' in 'where clause' (Query: "UPDATE `players` SET `AdminLevel` = '3' WHERE `Name` = SherifuL")
[01:37:24 09/24/16] [ERROR] CMySQLQuery::Execute - (error #1054) Unknown column 'SherifuL' in 'where clause' (Query: "SELECT `ID` FROM `players` WHERE `Name` = SherifuL")
[01:37:24 09/24/16] [WARNING] cache_get_field_content - no active cache
[01:37:24 09/24/16] [WARNING] CMySQLHandle::DeleteSavedResult - invalid result id ('0')
[01:37:24 09/24/16] [ERROR] CMySQLQuery::Execute[] - (error #1054) Unknown column 'SherifuL' in 'where clause' (Query: "UPDATE `players` SET `AdminLevel` = '0', `StaffPoints` = '0', `Skin` = '101' WHERE `Name` = SherifuL")
from this

Код HTML:
if(dialogid == DIALOG_ALIST2)
	{
		if(!response) return 1;
  		if(response)
		{
      		if(PlayerInfo[playerid][pAdmin] > 0)
			{
			    new rank = listitem+1;
			    new giveplayerid = GetPlayerID( PlayerInfo[playerid][pSelected] );

			    if(giveplayerid != INVALID_PLAYER_ID)
				{
				    if(PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, COLOR_ERROR, "Acel player nu este admin.");

				    new admin = PlayerInfo[playerid][pAdmin];
				    if(rank >= PlayerInfo[giveplayerid][pAdmin])
				    {
					    format(gString, sizeof(gString), "You promoted %s to admin %d.",GetName(giveplayerid), rank);
					    SendClientMessage(playerid, COLOR_SYN2, gString);
					    format(gString, sizeof(gString), "Owner-ul %s promoted you to admin %d.",GetName(playerid), rank);
					    SendClientMessage(giveplayerid, COLOR_SYN2, gString);

					    format(gString, sizeof(gString), "(A) {FFFFFF}%s a fost promovat la admin %d de Owner-ul %s.",GetName(giveplayerid), rank, GetName(playerid));
					    SendClanMessage(admin, COLOR_SYN, gString);
				    }
				    else
				    {
					    format(gString, sizeof(gString), "You demoted %s to admin %d.",GetName(giveplayerid), rank);
					    SendClientMessage(playerid, COLOR_SYN2, gString);
					    format(gString, sizeof(gString), "Owner-ul %s demoted you to admin %d.",GetName(playerid), rank);
					    SendClientMessage(giveplayerid, COLOR_SYN2, gString);

					    format(gString, sizeof(gString), "(A) {FFFFFF}%s a fost retrogradat la admin %d de Owner-ul %s.",GetName(giveplayerid), rank, GetName(playerid));
					    SendClanMessage(admin, COLOR_SYN, gString);
				    }
				    PlayerInfo[giveplayerid][pAdmin] = rank;
				    Update(giveplayerid,pAdminx);
				}
				else
				{
					gQuery[0] = (EOS);
					mysql_format(handle, gQuery, sizeof(gQuery), "SELECT `ID`, `AdminLevel` FROM `players` WHERE `Name` = %e", PlayerInfo[playerid][pSelected]);
					new Cache:result = mysql_query(handle, gQuery);
					new tmp[25], test, test2;

					cache_get_field_content(0, "ID", tmp), test = strval(tmp);
					cache_get_field_content(0, "Admin", tmp), test2 = strval(tmp);
					cache_delete(result);

                    gQuery[0] = (EOS);
    	            mysql_format(handle, gQuery, sizeof(gQuery), "UPDATE `players` SET `AdminLevel` = '%d' WHERE `Name` = %e", rank, PlayerInfo[playerid][pSelected]);
    	            mysql_tquery(handle, gQuery, "", "");

		            if(rank >= test2)
		            {
                        format(gString, sizeof(gString), "You promoted %s to admin %d.",PlayerInfo[playerid][pSelected], rank);
					    SendClientMessage(playerid, COLOR_SYN2, gString);

					    format(gString, sizeof(gString), "(A) {FFFFFF}%s (neconectat) a fost promovat la admin %d de Owner-ul %s.",PlayerInfo[playerid][pSelected], rank, GetName(playerid));
					    SendClanMessage(PlayerInfo[playerid][pCLeader], COLOR_SYN, gString);

		                format(gString, sizeof(gString), "Ai fost promovat la admin %d in staff.", rank);
   				        SendPlayerMail(GetSQLID(playerid), test , gString);
		            }
		            else
		            {
                        format(gString, sizeof(gString), "You demoted %s to admin %d.",PlayerInfo[playerid][pSelected], rank);
					    SendClientMessage(playerid, COLOR_SYN2, gString);

					    format(gString, sizeof(gString), "(A) {FFFFFF}%s (neconectat) a fost retrogradat la admin %d de Owner-ul %s.",PlayerInfo[playerid][pSelected], rank, GetName(playerid));
					    SendClanMessage(PlayerInfo[playerid][pCLeader], COLOR_SYN, gString);

		                format(gString, sizeof(gString), "Ai fost retrogradat la admin %d in staff.", rank);
   				        SendPlayerMail(GetSQLID(playerid), test , gString);
					}
				}
			}
			else return SendClientMessage(playerid,COLOR_ERROR,"Trebuie sa fii Owner ca sa accesezi acest meniu!");
		}
	}
 	if(dialogid == DIALOG_ALIST3)
	{
	    if(!response) return 1;
        if(response)
		{
            if(DialogExploit(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, "Ai folosit caractere nepermise in componenta motivului.");
		    if(PlayerInfo[playerid][pAdmin] > 5)
			{
				if(strlen(inputtext) > 2 && strlen(inputtext) < 31)
				{
				    new adminl = PlayerInfo[playerid][pAdmin];
				    new giveplayerid = GetPlayerID( PlayerInfo[playerid][pSelected] );
            	    if(giveplayerid != INVALID_PLAYER_ID)
				    {
                	    format(gString, sizeof (gString), "(A){FFFFFF} %s a fost scos din staff de Owner-ul %s, motiv: %s.", GetName(giveplayerid), GetName(playerid), inputtext);
					    SendAdminMessage(adminl, COLOR_SYN, gString);

					    PlayerInfo[giveplayerid][pAdmin] = 0;
					    Update(giveplayerid, pAdminx);
					    PlayerInfo[giveplayerid][pStaffPoints] = 0;
					    Update(giveplayerid,pStaffPointsx);


					    format(gString, sizeof(gString), "L-ai scos pe %s din staff , motiv: %s.",GetName(giveplayerid), inputtext);
					    SendClientMessage(playerid, COLOR_SYN2, gString);
					    format(gString, sizeof(gString), "Owner-ul %s te-a scos din staff , motiv: %s.",GetName(playerid), inputtext);
					    SendClientMessage(giveplayerid, COLOR_SYN2, gString);

					    // Feed
					    new feed[128];
					    format(feed, sizeof(feed), "~%d~ was kicked out from staff, by ~%d~", GetSQLID(giveplayerid), FactionName[PlayerInfo[playerid][pLeader]], GetSQLID(playerid));
					    mysql_format(handle, gQuery, sizeof(gQuery), "INSERT INTO `feed` (`text`,`time`) VALUES ('%e','%d')", feed, gettime());
					    mysql_tquery(handle, gQuery, "", "");
				    }
				    else
				    {
			    	    gQuery[0] = (EOS);
    	        	    mysql_format(handle, gQuery, sizeof(gQuery), "UPDATE `players` SET `AdminLevel` = '0', `StaffPoints` = '0', `Skin` = '101' WHERE `Name` = %e", PlayerInfo[playerid][pSelected]);
    	        	    mysql_tquery(handle, gQuery, "", "");

    	        	    format(gString, sizeof (gString), "(A){FFFFFF} %s (neconectat) a fost scos din staff de Owner-ul %s, motiv: %s.", PlayerInfo[playerid][pSelected], GetName(playerid), inputtext);
					    SendFactionMessage(PlayerInfo[playerid][pLeader], COLOR_SYN, gString);

					    format(gString, sizeof(gString), "L-ai scos pe %s din staff , motiv: %s.",PlayerInfo[playerid][pSelected], inputtext);
					    SendClientMessage(playerid, COLOR_SYN2, gString);

   					    gQuery[0] = (EOS);
					    mysql_format(handle, gQuery, sizeof(gQuery), "SELECT `ID` FROM `players` WHERE `Name` = %e", PlayerInfo[playerid][pSelected]);
					    new Cache:result = mysql_query(handle, gQuery);
					    new tmp[25], test;
				    	cache_get_field_content(0, "ID", tmp), test = strval(tmp);
					    cache_delete(result);

   					    format(gString, sizeof(gString), "Ai fost scos din staff , motiv: %s", inputtext);
   				        SendPlayerMail(GetSQLID(playerid), test , gString);
				    }
     		    }
     		    else return SendClientMessage(playerid,COLOR_ERROR,"Motivul trebuie sa contina intre 3 si 30 caractere.");
			}
			else return SendClientMessage(playerid,COLOR_ERROR,"Trebuie sa fii Owner-ul ca sa accesezi acest meniu!");
		}
	}
what is wrong , is the same from others sistem's ..
Reply
#2

Just add quotes in WHERE `Name` = %e
Код:
mysql_format(handle, gQuery, sizeof(gQuery), "UPDATE `players` SET `AdminLevel` = '%d' WHERE `Name` = '%e'", rank, PlayerInfo[playerid][pSelected]);
mysql_tquery(handle, gQuery, "", "");
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)