SQLite的新手,所以我不知道自己在做什么错。我只是在说一个错误:
SQLSTATE[HY000]: General error: 1 near "CREATE": syntax error
这是我的SQL:
CREATE TABLE users ( id INTEGER NOT NULL PRIMARY KEY, date_created DATETIME NOT NULL, date_updated DATETIME NOT NULL, username VARCHAR(32) NOT NULL, password VARCHAR(32) NOT NULL, role VARCHAR(32) NOT NULL DEFAULT 'member', first_name VARCHAR(50) NOT NULL, last_name VARCHAR(50) NOT NULL, email VARCHAR(128) NOT NULL ) CREATE TABLE subscribers ( id INTEGER NOT NULL PRIMARY KEY, name VARCHAR(40) DEFAULT NULL, email VARCHAR(255) NOT NULL UNIQUE ) CREATE TABLE weekly_download ( id INTEGER NOT NULL PRIMARY KEY, filename TEXT NOT NULL, download_date DATE NOT NULL, body TEXT )
在每个语句后加一个分号。
CREATE TABLE ( ... ) ; CREATE TABLE ( ... ) ;