06.05.2017, 21:44
hey there i saved every report on database MySql but when i load it it seems like wont work and it shows only 1 line not all
heres code where i load em
Command
heres code where i load em
Код:
function:ReportList(playerid)
{
new rows, fields;
cache_get_data(rows, fields, MySQLPipeline);
if(rows)
{
for(new row = 0; row < rows; row++)
{
new iMessage[128],Repotredby[128],ReporedTime[128],Reason[128], pName[MAX_PLAYER_NAME];
cache_get_field_content(row, "ReportedBy", pName, MySQLPipeline);
cache_get_field_content(row, "Reported", Repotredby, MySQLPipeline);
cache_get_field_content(row, "TimeDate", ReporedTime, MySQLPipeline);
cache_get_field_content(row, "Reason", Reason, MySQLPipeline);
format(iMessage,sizeof(iMessage),"%s - %s - %s -%s",pName,Repotredby,ReporedTime,Reason);
SendClientMessage(playerid, COLOR_GREY, iMessage);
return 1;
}
}
return 1;
}
Код:
COMMAND:reports(playerid, params[])
{
new iQuery[300];
mysql_format(MySQLPipeline, iQuery, sizeof(iQuery), "SELECT `Reported`, `ReportedBy`, `TimeDate`, `Reason` FROM `Reports`");
mysql_tquery(MySQLPipeline, iQuery, "ReportList", "d", playerid);
return 1;
}

