28.01.2019, 16:56
(
Последний раз редактировалось akib; 29.01.2019 в 00:36.
)
Why OnDealerCarsLoad not loading all datas available in database?
OnDealerCarsLoad:
It's loading only one data from MySql and it's only first data(1)
MySQL Table
OnDealerCarsLoad:
PHP код:
public OnDealerCarsLoad(){
new num_fields,num_rows,m[512];
cache_get_data(num_rows,num_fields,dbhandle);
if(!num_rows)return 1;
for(new i=0; i<num_rows; i++)
{
new id=GetFreeDSVehiceID();
DSVehicle[id][vehicle_sqlid]=cache_get_field_content_int(i, "id", dbhandle);
DSVehicle[id][vehicle_pos][0]=cache_get_field_content_float(i, "x", dbhandle);
DSVehicle[id][vehicle_pos][1]=cache_get_field_content_float(i, "y", dbhandle);
DSVehicle[id][vehicle_pos][2]=cache_get_field_content_float(i, "z", dbhandle);
DSVehicle[id][vehicle_model]=cache_get_field_content_int(i, "model", dbhandle);
DSVehicle[id][vehicle_price]=cache_get_field_content_int(i, "price", dbhandle);
DSVehicle[id][vehicle_dealer]=cache_get_field_content_int(i, "dealer", dbhandle);
format(m, sizeof(m), "This Vehicle Is For Sell!\nVehicle Name : %s\nPrice : $%i\nDealership : %s", VehicleNames[DSVehicle[id][vehicle_model]-400],DSVehicle[id][vehicle_price],GetDealershipName(DSVehicle[id][vehicle_dealer]));
DSVehicle[id][vehicle_text]=CreateDynamic3DTextLabel(m ,COLOR_ORANGE, DSVehicle[id][vehicle_pos][0], DSVehicle[id][vehicle_pos][1], DSVehicle[id][vehicle_pos][2],30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 7.0);
DSVehicle[id][vehicle_veh] = CreateVehicle(DSVehicle[id][vehicle_model], DSVehicle[id][vehicle_pos][0], DSVehicle[id][vehicle_pos][1], DSVehicle[id][vehicle_pos][2], DSVehicle[id][vehicle_angle], 0, 0, -1, 0);
}
return 1;
}
MySQL Table