SQLite Forum

How to add a column to a table using a query?
Login
Hello there,

I am writing a gamemode and I am using sqlite3 for saving.
Now when I need to add a column that has a float value, I can not directly add that in the phpliteadmin interface. I can only add integers and text columns with phpliteadmin. The problem here is that I have to recreate the entire table just to add a float column. So currently I am looking for a way to add a float column to a table by using a query.

This is what I've tried so far:
ALTER TABLE CHARACTERS ADD BLOOD FLOAT NOT NULL DEFAULT 100.0 WITH VALUES
ALTER TABLE CHARACTERS ADD BLOOD FLOAT DEFAULT 0.0
ALTER TABLE CHARACTERS ADD COLUMN BLOOD FLOAT DEFAULT 0.0

All 3 query's above gave me a really odd error:
Error:

That's right, the error was empty...
Any help would be appreciated.