MySql While loop
#1

Hello,

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();
}
Thnx,
Tom
Reply


Messages In This Thread
MySql While loop - by Tommboow - 13.08.2014, 22:42
Re: MySql While loop - by Tommboow - 15.08.2014, 15:50
Re: MySql While loop - by Vince - 15.08.2014, 15:53
Re: MySql While loop - by Tommboow - 15.08.2014, 16:49

Forum Jump:


Users browsing this thread: 1 Guest(s)