Fail to insert into adminlogs
#1

Hello.
When i unban someone, i want it to be posted in the table adminlogs.
This is the public:
PHP код:
forward UnSuspend(playeridname[]);
public 
UnSuspend(playeridname[])
{
    new 
num_rows,num_fields;
    
cache_get_data(num_rows,num_fields,dbhandle);
    new 
query[400],query2[400],string3[200], string[MAX_STRING],temp_ip[32],temp_gpci[100],string6[32],string5[60],query3[128];
    
cache_get_field_content(0"regip"temp_ip);
    
format(string6,sizeof(string6),"%s",temp_ip);
    
cache_get_field_content(0"reggpci"temp_gpci);
    
format(string5,sizeof(string5),"%s",temp_gpci);
format(query,sizeof(query),"DELETE FROM ipbanned WHERE username = '%s'",name);
   
mysql_function_query(dbhandle,query,false,"","");
   
format(query2,sizeof(query2),"DELETE FROM suspended WHERE username = '%s'",name);
   
mysql_function_query(dbhandle,query2,false,"","");
   
format(iStr,sizeof(iStr),"[UNSUSPEND] You have succesfully unsuspended %s"name);
   
SendClientMessage(playeridCOLOR_GREENiStr);
    
format(string3,sizeof(string3),"[UNSUSPEND] By %s",AnonAdmin(playerid));
   
format(string,sizeof(string), "4{ UNSUSPEND } %s has unsuspended %s",AnonAdmin(playerid), name);
       
format(query3,sizeof(query3),"INSERT INTO adminlogs (username,bywho,wat,whendidithappen,ip,gpci) VALUES ('%s','%s','%s','%s','%s','%s')",name,AnonAdmin(playerid),string3,TimeDate(),string6,string5);
    
mysql_function_query(dbhandle,query3,false,"","");
       
iEcho(string);
    return 
true;

this are the lines im talking about.
PHP код:
    format(string3,sizeof(string3),"[UNSUSPEND] By %s",AnonAdmin(playerid));name);
       
format(query3,sizeof(query3),"INSERT INTO adminlogs (username,bywho,wat,whendidithappen,ip,gpci) VALUES ('%s','%s','%s','%s','%s','%s')",name,AnonAdmin(playerid),string3,TimeDate(),string6,string5); 
It doesn't seem to work.
What have i done wrong?
Reply
#2

welp i fixed it.
I setted query3 from 128 to 400.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)