11.09.2014, 15:20
mysql_tquery(sqlconn,"SELECT * FROM prices","CarPriceLoadInit");
forward CarPriceLoadInit();
public CarPriceLoadInit()
{
if(!cache_num_rows())return print("No car prices to load!");
for(new i=0; i < cache_num_rows(); i++){
VehInfo[i][Model]=cache_get_field_content_int(i,"model");
VehInfo[i][Type]=cache_get_field_content_int(i,"type");
cache_get_field_content(i,"name",VehInfo[i][Name],sqlconn,64);
VehInfo[i][Price][0]=cache_get_field_content_int(i,"price");
}
printf("Loaded %d car prices.",cache_num_rows());
return 1;
}
forward CarPriceLoadInit();
public CarPriceLoadInit()
{
if(!cache_num_rows())return print("No car prices to load!");
for(new i=0; i < cache_num_rows(); i++){
VehInfo[i][Model]=cache_get_field_content_int(i,"model");
VehInfo[i][Type]=cache_get_field_content_int(i,"type");
cache_get_field_content(i,"name",VehInfo[i][Name],sqlconn,64);
VehInfo[i][Price][0]=cache_get_field_content_int(i,"price");
}
printf("Loaded %d car prices.",cache_num_rows());
return 1;
}