mysql_tquery not calling callback.
#1

hi, i'm having some issues with the following code:

PHP Code:
InitLoadCars(){
    
mysql_tquery(db"SELECT * FROM cars""LoadCarData""");
    return 
true;
}
forward LoadCarData();
public 
LoadCarData(){
    new 
rows;
    
cache_get_row_count(rows);
    if(!
rows)
        return print(
"No cars loaded.");
    if(
rows){
        for(new 
irowsji++){
            
cache_get_value_name_int(i"car_id"Car[i][car_id]);
            
cache_get_value_name_int(i"car_modelid"Car[i][car_modelid]);
            
//cache_get_value_name(i, "car_name", Car[i][car_name], 65);
            
cache_get_value_name_int(i"car_ownerid"Car[i][car_ownerid]); // should be owner's account_id;
            
cache_get_value_name_float(i"car_spawnX"Car[i][car_spawnX]);
            
cache_get_value_name_float(i"car_spawnY"Car[i][car_spawnY]);
            
cache_get_value_name_float(i"car_spawnZ"Car[i][car_spawnZ]);
            
cache_get_value_name_float(i"car_rot"Car[i][car_rot]);
            
cache_get_value_name(i"car_licensePlate"Car[i][car_licensePlate], 16);
            
cache_get_value_name_int(i"car_property"Car[i][car_property]);
            
cache_get_value_name_float(i"car_km"Car[i][car_km]);
            
//Car[i][car_lockStatus] = true;
            
Car[i][car_obj] = CreateVehicle(Car[i][car_modelid], Car[i][car_spawnX], Car[i][car_spawnY], Car[i][car_spawnZ], Car[i][car_rot], -1, -10);
            
printf("[CARS]: Loaded car id %d of modelid %d."Car[i][car_id], Car[i][car_modelid]);
        }
    }
    
printf("Loaded %d cars."rows);
    return 
true;

i'm calling InitLoadCars in main(), and the function gets called. i have tried moving either above or below, nothing. i called InitLoadCars in OnGameModeInit, nothing. I messed around as much as possible even went as far as making only one function with an inline, but even then got the same results. LoadCarData simply won't call.

here's some of the mysql log:

PHP Code:
[03/23/20 22:54:24] [INFOConnection handle with id '1' successfully created.
[
03/23/20 22:54:24] [DEBUGCHandleManager::Create - new handle 0x8fb9f18
[03/23/20 22:54:24] [DEBUGmysql_connect: return value'1'
[03/23/20 22:54:24] [DEBUGmysql_errno(1)
[
03/23/20 22:54:24] [DEBUGCHandle::GetErrorId(this=0x8fb9f18)
[
03/23/20 22:54:24] [DEBUGCConnection::GetError(this=0x8f9e800connection=0x9006220)
[
03/23/20 22:54:24] [DEBUGCHandle::GetErrorId - return valuetrueerror id'0'error msg''
[03/23/20 22:54:24] [DEBUGmysql_errno: return value'0'
[03/23/20 22:54:24] [DEBUGmysql_tquery(1"SELECT * FROM `cars`""LoadCarData""")
[
03/23/20 22:54:24] [DEBUGCCallback::Create(amx=0x8fc7a10name='LoadCarData'format=''params=0xf5368f44param_offset=5)
[
03/23/20 22:54:24] [DEBUGCCallback::Create callback index for 'LoadCarData'24
[03/23/20 22:54:24] [INFOCallback 'LoadCarData' set up for delayed execution.
[
03/23/20 22:54:24] [DEBUGcreated delayed callback with 0 parameter
[03/23/20 22:54:24] [DEBUGCHandle::Execute(this=0x8fb9f18type=1query=0x9031c54)
[
03/23/20 22:54:24] [DEBUGCHandle::Execute - return valuetrue
[03/23/20 22:54:24] [DEBUGmysql_tquery: return value'1'
[03/23/20 22:54:24] [DEBUGCThreadedConnection::WorkerFunc(this=0xf2c0b008connection=0xf2c0b008)
[
03/23/20 22:54:24] [DEBUGCThreadedConnection::WorkerFunc(this=0xf348d008connection=0xf348d008)
[
03/23/20 22:54:24] [DEBUGCThreadedConnection::WorkerFunc(this=0xf3d0f008connection=0xf3d0f008
Any actual help will be very much appreciated, I've been stuck on this for a while and just can't put my finger on it.
Reply


Messages In This Thread
mysql_tquery not calling callback. - by RazvyShel - 23.03.2020, 21:53
Re: mysql_tquery not calling callback. - by Adamoneoone - 23.03.2020, 22:05
Re: mysql_tquery not calling callback. - by RazvyShel - 23.03.2020, 22:15
Re: mysql_tquery not calling callback. - by Adamoneoone - 23.03.2020, 22:18
Re: mysql_tquery not calling callback. - by RazvyShel - 23.03.2020, 22:24
Re: mysql_tquery not calling callback. - by Adamoneoone - 23.03.2020, 22:27
Re: mysql_tquery not calling callback. - by RazvyShel - 23.03.2020, 22:33
Re: mysql_tquery not calling callback. - by SiaReyes - 24.03.2020, 04:50
Re: mysql_tquery not calling callback. - by RazvyShel - 24.03.2020, 07:29
Re: mysql_tquery not calling callback. - by SiaReyes - 24.03.2020, 07:32

Forum Jump:


Users browsing this thread: 1 Guest(s)