Example create table syntax
CREATE TABLE mytable(id integer PRIMARY KEY autoincrement, age integer, name text, timestamp DATETIME DEFAULT (strftime('%Y-%m-%d %H:%M:%S','now', 'localtime')));
Add a timestamp column
This column is always in GMT.
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
This column is always your local machine's time.
timestamp DATETIME DEFAULT (strftime('%Y-%m-%d %H:%M:%S','now', 'localtime'))
Check to see if a table exists
The only variable in the command is table_name.
sqlite> select name from sqlite_master where type='table' and name='table_name';
http://algorytmy.pl/doc/php/ref.sqlite.php »
Creating tables from the command line
http://www.sqlite.org/sqlite.html »
Autoincrement
http://www.sqlite.org/autoinc.html »
Create table syntax
http://www.sqlite.org/lang_createtable.html »