Error creating table: You have an error in your SQL syntax near ‘order( order_id INT UNSIGNED NOT NULL AUTO_INCREMENT, user_id ‘ at line 1

I am trying to create 2 tables in the same MySQL database with a PHP-script: table ‘user’ with primary key ‘user_id’ and table ‘order’ with primary key ‘order_id’ and foreign key ‘user_id’ from the ‘user’ table (1 to many relationship). Table user creates successfully without problems: $sql="CREATE TABLE user( user_id INT UNSIGNED NOT NULL AUTO_INCREMENT, … Read more

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax — PHP — PDO

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘from, to, name, subject, message) VALUES (‘[email protected]’, ‘[email protected]’ at line 1