Sqlite - Writing to string
#1

I have in my code, a system to copy info from a database to a variable for my vehicles. However, I am a total noob at SQLite (started learning today, yay me )..anyhow, I know how to write an integer, but how do I write a string?

I tried this:
pawn Код:
new Field[ 20 ];
db_get_field_assoc(Result, "OWNER", Field, 30);
VehicleInfo[vehicleID][vOwner] = Field;
but got this error:
Код:
error 047: array sizes do not match, or destination array is too small
The enum is like this:
pawn Код:
enum vInfo
{
    vFuel,
    vOwner[MAX_PLAYER_NAME],
    vModel,
    vCol1,
    vCol2,
    vID,
    Float:vSpawnX,
    Float:vSpawnY,
    Float:vSpawnZ,
    Float:vSpawnA,
};
While i'm making this thread, im also getting an error with this line
pawn Код:
format(Query, sizeof(Query), "SELECT * FROM `VEHICLES` WHERE `ID` = '%d' COLLATE NOCASE", DB_Escape(vehicleID));
Код:
error 035: argument type mismatch (argument 1)
Im not sure what I did wrong in string :P
Reply


Messages In This Thread
Sqlite - Writing to string - by Mattakil - 29.09.2013, 23:31
Re: Sqlite - Writing to string - by Scrillex - 29.09.2013, 23:38
Re: Sqlite - Writing to string - by Mattakil - 29.09.2013, 23:43

Forum Jump:


Users browsing this thread: 2 Guest(s)