MySQL Help
#1

Hello, I am doing a MySQL Vehicle System. I have a trouble loading the cars, this code only load the first row from my table, currently I have three vehicles instead.

Код:
for (new i = 1; i < num_rows; i++)
    {
		new cosa[300];
		format(cosa, sizeof(cosa), "ID: %d | Rows: %d", i, num_rows);
		printf(cosa);
		cache_get_field_content(i, "CarID", data), VehicleSystem[i][CarID] = strval(data);
		cache_get_field_content(i, "Model", data), VehicleSystem[i][Model]=strval(data);
		cache_get_field_content(i, "Locked", data), VehicleSystem[i][Locked]=strval(data);
		cache_get_field_content(i, "CarX", data), VehicleSystem[i][Carx]=strval(data);
		cache_get_field_content(i, "CarY", data), VehicleSystem[i][Cary]=strval(data);
		cache_get_field_content(i, "CarZ", data), VehicleSystem[i][Carz]=strval(data);
		cache_get_field_content(i, "CarA", data), VehicleSystem[i][Cara]=strval(data);
		cache_get_field_content(i, "Color1", data), VehicleSystem[i][Color1]=strval(data);
		cache_get_field_content(i, "Color2", data), VehicleSystem[i][Color2]=strval(data);
		cache_get_field_content(i, "Price", data), VehicleSystem[i][Price]=strval(data);
		cache_get_field_content(i, "Sell", data), VehicleSystem[i][Sell]=strval(data);
		cache_get_field_content(i, "Owner", data2), strmid(VehicleSystem[i][Owner],data2,0,30,30);
		new carr = CreateVehicle(VehicleSystem[i][Model],VehicleSystem[i][Carx],VehicleSystem[i][Cary],VehicleSystem[i][Carz]+5,VehicleSystem[i][Cara],VehicleSystem[i][Color1],VehicleSystem[i][Color2],600000);
  	}
In my server.cfg it shows printed:

Код:
ID: 1 | Rows: 3
And should be:

Код:
ID: 1 | Rows: 3
ID: 2 | Rows: 3
ID: 3 | Rows: 3
Thanks a lot!
Reply


Messages In This Thread
MySQL Help - by HidroDF - 28.08.2016, 00:41
Re: MySQL Help - by Kwarde - 28.08.2016, 01:02
Respuesta: MySQL Help - by HidroDF - 28.08.2016, 01:12
Re: MySQL Help - by Konstantinos - 28.08.2016, 08:11
Re: MySQL Help - by Kwarde - 28.08.2016, 11:32
Re: MySQL Help - by Konstantinos - 28.08.2016, 11:36
Respuesta: MySQL Help - by HidroDF - 28.08.2016, 11:52
Re: MySQL Help - by meranti1995 - 28.08.2016, 12:01
Re: MySQL Help - by Konstantinos - 28.08.2016, 12:03
Respuesta: MySQL Help - by HidroDF - 28.08.2016, 12:39

Forum Jump:


Users browsing this thread: 1 Guest(s)