04.01.2013, 19:37
Alright. So, what I need resolved is how to read through a query result, that has more than one row.
The code:
I tried that, but it doesn't seem to work.
The MySQL query is:
I need this resolved ASAP. Thank you
EDIT: IT'S NOT THE VERSION WITH CASHING! I know how to do it in that version, but I don't know how to here.
The code:
PHP код:
for(new i = 0; i < mysql_num_rows(); i++)
{
new row[128];
new field[5][128];
mysql_fetch_row_format(row, "|");
explode(row, field, "|");
CarStats[playerid][Unid][i] = strval(field[0]);
CarStats[playerid][Carid][i] = strval(field[1]);
CarStats[playerid][Ownerid][i] = strval(field[2]);
CarStats[playerid][Color1][i] = strval(field[3]);
CarStats[playerid][Color2][i] = strval(field[4]);
mysql_retrieve_row(); //Described to be the same as mysql_next_row();
}
The MySQL query is:
PHP код:
new str[128];
format(str, sizeof(str), "SELECT * FROM Cars WHERE Ownerid = '%d'", UserStats[playerid][Uniqueid]);
mysql_query(str);
mysql_store_result();
EDIT: IT'S NOT THE VERSION WITH CASHING! I know how to do it in that version, but I don't know how to here.