Moin,
habe mich nach folgendem Thread gerichtet:
und folgenden Code:
SendClientMessage(playerid,ROT,"debug1");
new query[300];
format(query,sizeof(query),"SELECT * FROM ´cars´");
mysql_query(query);
mysql_store_result();
if(!mysql_num_rows()) // hier ist nun die Abfrage ob die Einträge NULL ergeben bzw. ob es KEINE Einträge gibt
{
SendClientMessage(playerid,ROT,"debug2");
mysql_free_result(); //Muss da bleiben weil -> Siehe mysql_store_result
return 0;
}
new result[50];
while(mysql_retrieve_row()) //this will be running until all rows are processed
{
SendClientMessage(playerid,ROT,"debug3");
mysql_fetch_field_row(result,"x");
new Float:car_x = floatstr(result);
strdel(result,0,sizeof(result));
mysql_fetch_field_row(result,"y");
new Float:car_y = floatstr(result);
strdel(result,0,sizeof(result));
mysql_fetch_field_row(result,"z");
new Float:car_z = floatstr(result);
strdel(result,0,sizeof(result));
mysql_fetch_field_row(result,"color1");
new car_color1 = strval(result);
strdel(result,0,sizeof(result));
mysql_fetch_field_row(result,"color2");
new car_color2 = strval(result);
strdel(result,0,sizeof(result));
mysql_fetch_field_row(result,"modelid");
new car_modelid = strval(result);
strdel(result,0,sizeof(result));
/*mysql_fetch_field_row(result,"tank");
new car_tank = strval(result);
strdel(result,0,sizeof(result));*/
mysql_fetch_field_row(result,"damage");
new car_damage = strval(result);
strdel(result,0,sizeof(result));
/*new vehid=AddStaticVehicle(car_modelid,car_x,car_y,car_z,0,car_color1,car_color2);
SetVehicleParamsEx(vehid,0,0,0,1,0,0,0);
SetVehicleHealth(vehid,car_damage);*/
}
mysql_free_result();
Jedoch funktioniert die Abfrage nicht ganz, denn die While Schleife wird nicht ausgeführt.
Was mache ich falsch?
Gruß