MySQL multirow
#1

Here is the code:


pawn Код:
new string[128];
format(string, sizeof(string), "SELECT * FROM vehicles WHERE Owner = '%s'", Name(playerid));
mysql_query(string);
mysql_store_result();
new nv = mysql_num_rows();
if(!nv)return SendClientMessage(playerid,ErrorColor,"You don't own a vehicle.");
new idx;
new row[130];
new field[8][40];
while(mysql_fetch_row_format(row, "|"))
{
explode(row, field, "|");
formatedmessage(playerid,-1,"RESULT: %s",strval(field[5]));
idx++;
}
mysql_free_result();
I am confused with MySQL. All i want is to get the vehicle model and send it as a client message to the player.
However what i get is that; "RESULT:0OwnerName". I really don't know how this exactly works and i would appreciate some help.
Reply


Messages In This Thread
MySQL multirow - by mike_1 - 11.12.2014, 18:23
Re: MySQL multirow - by Divergent - 11.12.2014, 20:10

Forum Jump:


Users browsing this thread: 1 Guest(s)