Sqlite - Writing to string - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Sqlite - Writing to string (
/showthread.php?tid=466892)
Sqlite - Writing to string -
Mattakil - 29.09.2013
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
Re: Sqlite - Writing to string -
Scrillex - 29.09.2013
new Field[ 20 ]; = array sizes do not match
Because = db_get_field_assoc(Result, "OWNER", Field, 30);
30!
Re: Sqlite - Writing to string -
Mattakil - 29.09.2013
Yeah, that was the problem /facepalm.. thanks!