SQL Error
#4

PHP код:
CMD:top10on(playeridparams[])
{
    new 
query[100];
    
mysql_format(connectionquerysizeof(query), "SELECT * FROM TableName ORDER BY pHours LIMIT 10;");
    
mysql_tquery(connectionquery"top10onQ""d"playerid);
    return 
1;
}
forward top10onQ(playerid);
public 
top10onQ(playerid)
{
    for(new 
i=0i<cache_get_row_count(); i++)
    {
        new
            
username[MAX_PLAYER_NAME 1],
            
pphour,
            
ppmins,
            
sub_info[50]
        ;
        
GetPlayerName(playeridusernamesizeof(username));
        
cache_get_field_content(i"user"username);
        
pphour cache_get_field_content_int(i"phours");
        
ppmins cache_get_field_content_int(i"pminutes");
        
format(sub_infosizeof(sub_info), "%s"ccwhite"%d. %s with "ccgreen"%d "ccwhite"hours, "ccgreen"%d "ccwhite"minutes\n"row 1IDusernamepphourppmins);
        
strcat(full_infosub_info);
    }
    
ShowPlayerDialog(playerid1101DIALOG_STYLE_MSGBOX"Top 10 Online"full_info"OK""Cancel");
    return 
1;

This should work, might have a few typo's but you can correct those I guess... this is pretty fast but yeah.
Reply


Messages In This Thread
SQL Error - by Bondage - 04.10.2015, 18:12
Re: SQL Error - by J0sh... - 04.10.2015, 18:16
Re: SQL Error - by Bondage - 04.10.2015, 18:24
Re: SQL Error - by d1git - 04.10.2015, 18:32

Forum Jump:


Users browsing this thread: 1 Guest(s)