I use PDO and try to make my application support MySQL and SQLite, but in sqlite I get this error when trying to import my database schema:
SQLSTATE[HY000]: General error: 1 near "AUTO_INCREMENT": syntax error
The request is as follows:
CREATE TABLE events ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(32) NOT NULL, title VARCHAR(64) NOT NULL, description LONGTEXT, starttime DATETIME DEFAULT '0000-00-00 00:00:00', PRIMARY KEY(id), KEY name(name) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
(and it works in a MySQL database.)
I do not understand what the problem is? Should both database systems be compatible?
source share