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
#2

new Field[ 20 ]; = array sizes do not match

Because = db_get_field_assoc(Result, "OWNER", Field, 30);

30!
Reply
#3

Yeah, that was the problem /facepalm.. thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)