I'm trying to get all the outside coords from my houses to place some icons on the map but the only thing i now get is 000000 000000 000000.
but there are 2 records into my db so i think my while loop is kinda wrong, can someone explain me how this while loop works on samp. I'm using the mysql R34.
Код:
forward loadHouses(playerid);
public loadHouses(playerid){
SendClientMessage(playerid,YELLOW,"Loading houses...");
new query[128],message[200],Float:Xc,Float:Yc,Float:Zc;
mysql_format(mysql, query, sizeof(query),"SELECT `OX`, `OY`, `OZ` FROM `houses`");
mysql_tquery(mysql, query, "", "");
mysql_store_result();
while(mysql_fetch_row(query))
{
new b[256];
mysql_fetch_field_row(b,"OX");
Xc = strval(b);
mysql_fetch_field_row(b,"OY");
Yc = strval(b);
mysql_fetch_field_row(b,"OZ");
Zc = strval(b);
format(message, sizeof(message), "%f %f %f",Xc,Yc,Zc);
SendClientMessage(playerid,YELLOW,message);
}
mysql_free_result();
}
Threaded queries (basically R7+) require a callback. Those parameters in mysql_tquery actually have a use. See the example on the wiki:
can you just give me a example of a query with a while loop afther it to go trough all values ?