MYSQL admin logs
#1

Hey, i have problem with making admin logs

PHP код:
stock AdminLog(playerid[], playerb[], tegevus[], p6hjus[])
{
    new 
Query[100];
    new 
hourminutesecondyearmonthday;
    
getdate(yearmonthday);
    
gettime(hourminutesecond);
(
line 232) ->    format(Querysizeof(Query), "INSERT INTO `admin_logs` (`Admin`, `Player`, `Tegevus`, `Pхhjus`, `Kuu`, `Kell`) VALUES('%s', '%s', '%s', '%s', '%d/%d/%d', '%d:%d:%d')"RPN(playerid), RPN(playerb), tegevusp6hjusmonthdayyearhourminutesecond);
 (
line 233) -> mysql_query(Query);

and here is error
Код:
(232) : error 035: argument type mismatch (argument 1)
(233) : error 035: argument type mismatch (argument 1)
Reply
#2

Hello!

Try this:
PHP код:
stock AdminLog(playerid,playerb,tegevus,p6hjus[])
{
    new 
Query[250],hour,minute,second,year,month,day;
    
getdate(year,month,day);
    
gettime(hour,minute,second);
    
format(Query,sizeof Query,"INSERT INTO `admin_logs` (`Admin`,`Player`,`Tegevus`,`Pхhjus`,`Kuu`,`Kell`) VALUES ('%s','%s','%s','%s','%d/%d/%d','%d:%d:%d')",
    
RPN(playerid),RPN(playerb),tegevus,p6hjus,month,day,year,hour,minute,second);
    
mysql_query(Query);
    return 
1;

You have create playerid and playerb as a string but it should be an integer.


- Mencent
Reply
#3

Thanks, but if i type this under commands then it give me again this error

PHP код:
AdminLog("Slap",RPN(playerb), P6hjus); 
Reply
#4

PHP код:
AdminLog(playerid,playerb,"Slap",P6hjus); 
Try this


- Mencent
Reply
#5

Try this

Quote:

new Query[512];

Quote:

mysql_query(SQL ,Query);

Reply
#6

Quote:
Originally Posted by Belengher
Посмотреть сообщение
Try this
Bullshit.

He put a string into a integer-parameter, and this was the mistake.


- Mencent
Reply
#7

Thanks for responding, but it dont work, now it give me
Код:
error 035: argument type mismatch (argument 3)
Reply
#8

PHP код:
stock AdminLog(playerid,playerb,tegevus[],p6hjus[]) 

    new 
Query[250],hour,minute,second,year,month,day
    
getdate(year,month,day); 
    
gettime(hour,minute,second); 
    
format(Query,sizeof Query,"INSERT INTO `admin_logs` (`Admin`,`Player`,`Tegevus`,`Pхhjus`,`Kuu`,`Kell`) VALUES ('%s','%s','%s','%s','%d/%d/%d','%d:%d:%d')"
    
RPN(playerid),RPN(playerb),tegevus,p6hjus,month,day,year,hour,minute,second); 
    
mysql_query(Query); 
    return 
1

So.


- Mencent
Reply
#9

Код:
error 035: argument type mismatch (argument 1)
error line:
PHP код:
 mysql_query(Query); 
Reply
#10

PHP код:
mysql_query(conHandle,Query); 
conHandle is the connection handle, I don't know how you named this.


- Mencent
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)