SA-MP Forums Archive
Sqlite adding fields - 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 adding fields (/showthread.php?tid=468000)



Sqlite adding fields - Mattakil - 06.10.2013

Just wanna know, is there a way to add a field to a sqlite database? Like CREATE FIELD IF NOT EXIST or something?

I tried to make one in SQLite Database browser but it only lets me create a field at the beginning of the table, and I kinda want it at the end of the table (im picky :P)


Re: Sqlite adding fields - Emmet_ - 06.10.2013

Yeah, you can do this:

pawn Код:
ALTER TABLE `Field` ADD COLUMN `ColumnName` DEFAULT 0
You just need to execute it using db_query or something.