MySQL problem
#3

PHP код:
forward OnLoadFactionVehicles();
stock LoadFactionVehicles()
{
    
mysql_function_query(MySQL"SELECT * FROM `vehicledata`"true"OnLoadFactionVehicles""");
    return 
1;
}
public 
OnLoadFactionVehicles()
{
    new 
rowsfields;
    
cache_get_data(rowsfieldsMySQL);
    if(
rows)
    {
        for(new 
0rowsv++)
        {
            new 
vID cache_get_field_content_int(v"ID");
            
vInfo[vID][ID] = vID;
            
vInfo[vID][ModelID] = cache_get_field_content_int(v"ModelID");
            
vInfo[vID][posX] = cache_get_field_content_float(v"posX");
            
vInfo[vID][posY] = cache_get_field_content_float(v"posY");
            
vInfo[vID][posZ] = cache_get_field_content_float(v"posZ");
            
vInfo[vID][posA] = cache_get_field_content_float(v"posA");
            
vInfo[vID][ColorA] = cache_get_field_content_int(v"ColorA");
            
vInfo[vID][ColorB] = cache_get_field_content_int(v"ColorB");
            
vInfo[vID][Faction] = cache_get_field_content_int(v"Faction");
            
cache_get_field_content(v"Plate"vInfo[vID][NrPlate]);
        }
    }
    return 
1;

This is the way I load from MySQL... works great.

Also you was sending a lot of queries to the database, this will most defiantly slow down the server / make it lag. This sends 1 query.
Reply


Messages In This Thread
MySQL problem - by McGuiness - 04.06.2015, 12:16
Re: MySQL problem - by McGuiness - 04.06.2015, 17:42
Re: MySQL problem - by d3ll - 04.06.2015, 17:55
Re: MySQL problem - by McGuiness - 04.06.2015, 18:03
Re: MySQL problem - by d3ll - 04.06.2015, 18:08
Re: MySQL problem - by McGuiness - 04.06.2015, 18:27
Re: MySQL problem - by rappy93 - 04.06.2015, 18:34

Forum Jump:


Users browsing this thread: 1 Guest(s)