SQLite issue
#1

hey guys - beenplaying around with sqlite a bit and Had some pretty god luck until i hit a query that is rather large ad have to split the string and join using strcat():

pawn Код:
format(QueryA, sizeof(QueryA), "INSERT INTO `VEHICLES` (`ID`, `VALID`, `MODEL`, `XPOS`, `YPOS`, `ZPOS`, `ZAPOS`, `COL1`, `COL2`, `COST`, `BOUGHT`, `SECURE`, `ASECURE`, `BUYBAR`, `MOD1`, `MOD2`,` MOD3`, `MOD4`, `MOD5`, `MOD6`, `MOD7`, `MOD8`, `MOD9`, `MOD10`, `MOD11`, `MOD12`, `MOD13`, `MOD14`, `MOD15`, `MOD16`, `MOD17`, `OWNER`, `NAME`, `PAINTJOB`, `FACTION`)");
                format(QueryB, sizeof(QueryB), " VALUES('%d', '1', '%d', '%f', '%f', '%f', '%f', '%d', '%d', '%d', ",varID, VehicleSetupInfo[varID][model], VehicleSetupInfo[varID][x_spawn], VehicleSetupInfo[varID][y_spawn], VehicleSetupInfo[varID][z_spawn], VehicleSetupInfo[varID][za_spawn], VehicleSetupInfo[varID][color_1], VehicleSetupInfo[varID][color_2], VehicleSetupInfo[varID][vehiclecost]);
                strcat(QueryA, QueryB);
                format(QueryB, sizeof(QueryB), "'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '[NULL]', '%s', '-1', '-1' )", DB_Escape(VehicleSetupInfo[varID][name]));
                strcat(QueryA, QueryB);
                db_query(TSYS_Database, QueryA);

Is that the right way to do it or am I being dumb because it don't work lol. Is there a better way to do it than this and would somebody be kind enough to show me it? Thanks in advance guys
Reply


Messages In This Thread
SQLite issue - by CJay9209 - 23.04.2013, 07:08
Re: SQLite issue - by DaTa[X] - 23.04.2013, 07:11
Re: SQLite issue - by CJay9209 - 23.04.2013, 07:15
Re: SQLite issue - by KiNG3 - 23.04.2013, 08:25
Re: SQLite issue - by Emmet_ - 23.04.2013, 10:05
Re: SQLite issue - by KiNG3 - 23.04.2013, 10:55
Re: SQLite issue - by Emmet_ - 23.04.2013, 11:04
Re: SQLite issue - by rhds - 23.04.2013, 12:22
Re: SQLite issue - by Finn - 23.04.2013, 13:47

Forum Jump:


Users browsing this thread: 1 Guest(s)