R5 to R39
#1

Hello everyone sorry for this bump but this cant wait i need to change my server from R5 to R39

I just need to learn so i want to tell mee an problem and i will try to fixh the others

This is the code of R5

PHP код:
        new Query[256],string[128],pname[24],escpname[24];
        
GetPlayerName(playerid,pname,24);
        
mysql_real_escape_string(pnameescpname);
        
format(Querysizeof(Query), "SELECT * FROM `users` WHERE `Username` = '%s'"escpname);
        
mysql_query(Query);
        
mysql_store_result();
        if(
mysql_num_rows() != 0)
        { 
This was good on R5 but in R39 i get errors

PHP код:
C:\Users\Arlindi.Arlindi-PC\Desktop\Servers\fdfs\gamemodes\zma4.pwn(1199) : error 035argument type mismatch (argument 1)
C:\Users\Arlindi.Arlindi-PC\Desktop\Servers\fdfs\gamemodes\zma4.pwn(1200) : error 017undefined symbol "mysql_store_result"
C:\Users\Arlindi.Arlindi-PC\Desktop\Servers\fdfs\gamemodes\zma4.pwn(1201) : error 017undefined symbol "mysql_num_rows" 
Thanks
Reply
#2

undefined symbol "mysql_store_result"
C:\Users\Arlindi.Arlindi-PC\Desktop\Servers\fdfs\gamemodes\zma4.pwn(1201) : error 017: undefined symbol "mysql_num_rows" - it tells you that they're undefined. Meaning they're not in R39.
Reply
#3

When i use R39 I get dhat errors
When i use R5 i dont get errors
Reply
#4

Exactly. Like I've JUST said, they're not in R39.
Reply
#5

Yes and i dont know what i must change to set him to r39
Can you help mee ?
Reply
#6

here's an example how you can

PHP код:
SelectNameFromDB(playerid)
{
    new 
Query[256],string[128],pname[24]; 
    
GetPlayerName(playerid,pname,24); 
    
mysql_format(mysql,Querysizeof(Query), "SELECT * FROM `users` WHERE `Username` = '%e'"pname);//since mysql_format already have escape name just use %e 
    
mysql_tquery(mysqlQuery"GetRowFromDB""i",playerid); // now we will run threaded query
    
return true;
}
forward GetRowFromDB(playerid);
public 
GetRowFromDB(playerid)
{
    new 
rowsfields;
    
cache_get_data(rowsfieldsmysql);
    if(
rows
    {
        
PlayerInfo[playerid][Level] = cache_get_field_content_int(0"level"); // this is an example how you can get integer by row name
        
SendClientMessage(playerid, -1"Row Founded");
    }
    else
    {
        
SendClientMessage(playerid, -1"Sorry No Row found ");
    }
    return 
true;

Reply
#7

i understand this but how to change my problem
I cant unedrstand it too mutch
Can you fix it pleae ?
Reply
#8

try this

PHP код:
       new Query[256],string[128],pname[24]; 
        
GetPlayerName(playerid,pname,24);  
        
mysql_format(Querysizeof(Query), "SELECT * FROM `users` WHERE `Username` = '%e'"pname); 
        
mysql_tquery(mysqlQuery,""""); 
        if(
cache_get_row() != 0
        { 
Reply
#9

PHP код:
        new Query[256],string[128],pname[24];
        
GetPlayerName(playerid,pname,24);
        
mysql_format(Querysizeof(Query), "SELECT * FROM `users` WHERE `Username` = '%e'"pname);// here is problem
        
mysql_tquery(mysqlQuery,"""");
        if(
cache_get_row() != 0

PHP код:
C:\Users\Arlindi.Arlindi-PC\Desktop\Servers\fdfs\gamemodes\zma4.pwn(1197) : error 035argument type mismatch (argument 1)
C:\Users\Arlindi.Arlindi-PC\Desktop\Servers\fdfs\gamemodes\zma4.pwn(1197) : error 035argument type mismatch (argument 2
Reply
#10

Hello!

Try it so:
PHP код:
mysql_format(mysql,Querysizeof(Query), "SELECT * FROM `users` WHERE `Username` = '%e'"pname);// here is problem 
Mencent
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)