SQLite last_insert_rowid() tag mismatch
#6

Quote:
Originally Posted by Ihateyou
Посмотреть сообщение
show LoadVehicle() or try strval(Result) or something
strval wouldn't work other than giving a different tag mismatch, here is the LoadVehicle stock:
pawn Код:
stock LoadVehicle(id)
{  
    new
        DBResult: Result,
        Query[256],
        temp[256];
       
    format(Query, sizeof Query, "SELECT * FROM `vehicles` WHERE `id` = %i", id);   
    db_query(Database, Query);
   
    if(db_num_rows(Result))
    {
        db_get_field_assoc(Result, "id", temp, sizeof temp);
        Vehicle[id][vSQLID] = strval(temp);
       
        db_get_field_assoc(Result, "modelid", temp, sizeof temp);
        Vehicle[id][vModel] = strval(temp);
       
        db_get_field_assoc(Result, "pos_x", temp, sizeof temp);
        Vehicle[id][vPos][0] = floatstr(temp);
       
        db_get_field_assoc(Result, "pos_y", temp, sizeof temp);
        Vehicle[id][vPos][1] = floatstr(temp);
       
        db_get_field_assoc(Result, "pos_z", temp, sizeof temp);
        Vehicle[id][vPos][2] = floatstr(temp);
       
        db_get_field_assoc(Result, "pos_r", temp, sizeof temp);
        Vehicle[id][vPos][3] = floatstr(temp);
       
        db_get_field_assoc(Result, "colour1", temp, sizeof temp);
        Vehicle[id][vColour][0] = strval(temp);
       
        db_get_field_assoc(Result, "colour2", temp, sizeof temp);
        Vehicle[id][vColour][1] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_0", temp, sizeof temp);
        Vehicle[id][vMods][0] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_1", temp, sizeof temp);
        Vehicle[id][vMods][1] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_2", temp, sizeof temp);
        Vehicle[id][vMods][2] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_3", temp, sizeof temp);
        Vehicle[id][vMods][3] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_4", temp, sizeof temp);
        Vehicle[id][vMods][4] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_5", temp, sizeof temp);
        Vehicle[id][vMods][5] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_6", temp, sizeof temp);
        Vehicle[id][vMods][6] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_7", temp, sizeof temp);
        Vehicle[id][vMods][7] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_8", temp, sizeof temp);
        Vehicle[id][vMods][8] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_9", temp, sizeof temp);
        Vehicle[id][vMods][9] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_10", temp, sizeof temp);
        Vehicle[id][vMods][10] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_11", temp, sizeof temp);
        Vehicle[id][vMods][11] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_12", temp, sizeof temp);
        Vehicle[id][vMods][12] = strval(temp);
       
        db_get_field_assoc(Result, "mod_slot_13", temp, sizeof temp);
        Vehicle[id][vMods][13] = strval(temp);
       
        db_get_field_assoc(Result, "fuel", temp, sizeof temp);
        Vehicle[id][vFuel] = strval(temp);
       
        Vehicle[id][vVID] = CreateVehicle(Vehicle[id][vModel], Vehicle[id][vPos][0], Vehicle[id][vPos][1], Vehicle[id][vPos][2], Vehicle[id][vPos][3], Vehicle[id][vColour][0], Vehicle[id][vColour][1], -1);
    }
   
    db_free_result(Result);
    return 1;
}
Reply


Messages In This Thread
SQLite last_insert_rowid() tag mismatch - by arko123 - 29.07.2014, 15:00
Re: SQLite last_insert_rowid() tag mismatch - by arko123 - 29.07.2014, 15:33
Re: SQLite last_insert_rowid() tag mismatch - by arko123 - 29.07.2014, 18:14
Re: SQLite last_insert_rowid() tag mismatch - by arko123 - 30.07.2014, 00:08
Re: SQLite last_insert_rowid() tag mismatch - by Ihateyou - 30.07.2014, 00:29
Re: SQLite last_insert_rowid() tag mismatch - by arko123 - 30.07.2014, 00:34
Re: SQLite last_insert_rowid() tag mismatch - by Ihateyou - 30.07.2014, 00:45
Re: SQLite last_insert_rowid() tag mismatch - by arko123 - 30.07.2014, 00:46
Re: SQLite last_insert_rowid() tag mismatch - by Ihateyou - 30.07.2014, 00:48
Re: SQLite last_insert_rowid() tag mismatch - by arko123 - 30.07.2014, 00:54

Forum Jump:


Users browsing this thread: 1 Guest(s)