MySQL ban SELECT error
#1

Hello, i make a kind of ban system but when i try to check the databse this error happens:
PHP код:
(error #1054) Unknown column 'Banditul' in 'where clause' (Query: "SELECT * FROM `bans` WHERE (`BanName` = `Banditul` OR `IP` = '127.0.0.1') LIMIT 1") 
SELECT statement at OnPlayerConnect:
PHP код:
mysql_format(g_SQLquerysizeof(query),"SELECT * FROM `bans` WHERE (`BanName` = `%e` OR `IP` = '%e') LIMIT 1",APlayerData[playerid][PlayerName],IP);
    
mysql_tquery(g_SQLquery"BanCheck","i",playerid); 
The callback:
PHP код:
forward BanCheck(playerid);
public 
BanCheck(playerid)
{
    new 
admin[24], pname[24],Reason[60], string[60],bantime;
    new 
rows cache_num_rows();
    if(
rows
    {
        for(new 
rowrow rowsrow++) 
        {
              
cache_get_field_content(row"AdminName"adming_SQLsizeof(admin));
              
cache_get_field_content(row"BanName"pnameg_SQLsizeof(pname));
              
cache_get_field_content(row"Reason"Reasong_SQLsizeof(Reason));
              
bantime cache_get_field_content_int(row"BanTime"g_SQL);
          }
      }
    
SendClientMessage(playeridC_RED,"Esti banat pe acest server!");
    
SendClientMessage(playeridC_RED,"___________________");
    
format(stringsizeof(string),"Admin: %s"admin);
    
SendClientMessage(playeridC_REDstring);
    
format(stringsizeof(string),"Nume: %s"pname);
    
SendClientMessage(playeridC_REDstring);
    
format(stringsizeof(string),"Motiv: %s"Reason);
    
SendClientMessage(playeridC_REDstring);
    
format(stringsizeof(string),"Timp ramas: %s"CalculateBanTime(bantime));
    
SendClientMessage(playeridC_REDstring);
    
SendClientMessage(playeridC_RED,"___________________");
    
SendClientMessage(playeridC_RED"Daca crezi ca ai primit ban pe nedrept fa o poza(F8) si posteaza-o pe forum la sectiuena serverului.");
    
SendClientMessage(playeridC_RED"www.gamelive.ro/forum");
    
SetTimerEx("TimedKick"500false"i"playerid);
    return 
1;

And the actual table:
http://imgur.com/KMTDrWe
Reply
#2

PHP код:
mysql_format(g_SQLquerysizeof(query),"SELECT * FROM `bans` WHERE (`BanName` = '%e' OR `IP` = '%e') LIMIT 1",APlayerData[playerid][PlayerName],IP); 
    
mysql_tquery(g_SQLquery"BanCheck","i",playerid); 
Reply
#3

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
PHP код:
mysql_format(g_SQLquerysizeof(query),"SELECT * FROM `bans` WHERE (`BanName` = '%e' OR `IP` = '%e') LIMIT 1",APlayerData[playerid][PlayerName],IP); 
    
mysql_tquery(g_SQLquery"BanCheck","i",playerid); 
Thanks
Well now i see, this is kinda stupid from me.....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)