cache_num_row
#1

Hi. When I type /reports it shows that "There are no Reports" but at MySQL there are 6 reports.

Why?

PHP код:
CMD:reports(playeridparams[])
{
    if(
pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid,-1,""COL_RED"Not Admin!");
    new 
str[128], Cache:reports;
    
mysql_format(mysqlstrsizeof(str), "SELECT * FROM `reportlog`");
    
reports mysql_query(mysqlstrtrue);
    new 
count cache_num_rows();
    if(
count 0)
    {
         
SendClientMessage(playerid, -1"Reports:");
        for(new 
0counti++)
        {
            new 
reporter[25], reported[25], reportidreportedon[25], reportreason[25], showreps[450];
            
reportid cache_get_field_content_int(i"ID");
            
cache_get_field_content(i"Username"reporter);
            
cache_get_field_content(i"Targetname"reported);
            
cache_get_field_content(i"Data"reportedon);
            
cache_get_field_content(i"Report"reportreason);
            
format(showrepssizeof(showreps), "[#%d] (%s) %s has reported %s! [Reason: %s]"reportidreportedonreporterreportedreportreason);
            
SendClientMessage(playeridREDshowreps);
        }
    }
    else return 
SendClientMessage(playeridRED"There are currently no reports!");
    
cache_delete(reports);
    return 
1;

Mysql rows are: ID, Username, Targetname, Data, Report,
Reply


Messages In This Thread
cache_num_row - by Zeus666 - 21.10.2018, 14:13
Re: cache_num_row - by Chyakka - 21.10.2018, 14:21
Re: cache_num_row - by Zeus666 - 21.10.2018, 14:26
Re: cache_num_row - by Chyakka - 21.10.2018, 14:29
Re: cache_num_row - by Zeus666 - 21.10.2018, 14:30
Re: cache_num_row - by ReD_HunTeR - 21.10.2018, 14:37
Re: cache_num_row - by Zeus666 - 21.10.2018, 15:11
Re: cache_num_row - by Zeus666 - 21.10.2018, 15:31
Re: cache_num_row - by ReD_HunTeR - 21.10.2018, 15:33
Re: cache_num_row - by Zeus666 - 21.10.2018, 15:39

Forum Jump:


Users browsing this thread: 1 Guest(s)