EnexoOnoma
EnexoOnoma

Reputation: 8836

SQL syntax error maybe because of the version I use

On phpMyAdmin, when I create this table the SQL is executed correctly but when I add all the sql code I get an error saying

"#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 'CREATE TABLEbuying(CustomerIDint(10) unsigned NOT NULL,PurchaseI' at line 14`"

Why is that and how can I fix it ?

Upvotes: 0

Views: 55

Answers (2)

Jason McCreary
Jason McCreary

Reputation: 72991

If you are running multiple SQL statements, they need to be ended with a ; (semi-colon)

Upvotes: 1

user562854
user562854

Reputation:

You have to use a semicolon ; after each CREATE TABLE sometable ( ) statement.

CREATE TABLE `table1` (
...
);
CREATE TABLE `table2` (
...
);

Upvotes: 3

Related Questions