GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: sticky2 - 2015. Május 23. - 10:02:50

Cím: [MySQL] cache_get_data - no active cache
Írta: sticky2 - 2015. Május 23. - 10:02:50
Helló!
Ismét elakadtam, a járművek betöltésénél :D
 
[WARNING] cache_get_data - no active cache

 

forward LoadVehicles();
public LoadVehicles()
{
new check[200];
new rows, fields;
cache_get_data(rows, fields);
for(new i = 1; i < rows; i++)
{
    format(check, sizeof(check), \"SELECT * FROM `vehicles` WHERE `id`=\'%d\'\", i);
    mysql_query(mysql, check);
    mysql_store_result();
   new owner[64], plate[32];
           cache_get_field_content(0, \"owner\", owner);
              cache_get_field_content(0, \"plate\", plate);
            VehicleInfo[Model] = cache_get_field_content_int(i, \"model\");
            VehicleInfo[Owner] = owner;
//........
            mysql_free_result();
       }
       return 1;
}
Cím: [MySQL] cache_get_data - no active cache
Írta: norbinator09 - 2015. Május 23. - 10:32:36

forward LoadVehicles();
public LoadVehicles()
{
new check[200];
new rows, fields;
 
for(new i = 1; i < rows; i++)
{
    format(check, sizeof(check), \"SELECT * FROM `vehicles` WHERE `id`=\'%d\'\", i);
    mysql_query(mysql, check);
    mysql_store_result();
            cache_get_data(rows, fields);
   new owner[64], plate[32];
           cache_get_field_content(0, \"owner\", owner);
              cache_get_field_content(0, \"plate\", plate);
            VehicleInfo[Model] = cache_get_field_content_int(i, \"model\");
            VehicleInfo[Owner] = owner;
//........
            mysql_free_result();
       }
       return 1;
}
Cím: [MySQL] cache_get_data - no active cache
Írta: lackos888 - 2015. Május 23. - 10:38:30
Az a mysql query felesleges szerintem a lekérdezésbe.
Szóval:
 

forward LoadVehicles();
public LoadVehicles()
{
new check[200];
new rows, fields;
cache_get_data(rows, fields);
for(new i = 1; i < rows; i++)
{
new owner[64], plate[32];
           cache_get_field_content(i, \"owner\", owner);
             cache_get_field_content(i, \"plate\", plate);
            VehicleInfo[Model] = cache_get_field_content_int(i, \"model\");
            VehicleInfo[Owner] = owner;
//........
       }
       return 1;
}

 
Gondolom a lekérdezésed SELECT * FROM `vehicles`és threados query LoadVehicles-re szól.
Cím: [MySQL] cache_get_data - no active cache
Írta: sticky2 - 2015. Május 23. - 18:59:06
Megvan, köcce ;)