SQL syntax error creating table? - php 5.5.1
I'm a beginner programmer in PHP (5.5.1) and MySQL. When I'm creating a
table called message in my database called chat, this is the error:
Error creating Table: 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 CHAR(30),to TEXT(300),text TEXT(1000),index INT(10) NOT
NULL AUTO_INCREMENT' at line 1
The full MySQL statement is:
CREATE TABLE message(date DATE,from CHAR(30),to TEXT(300),text
TEXT(1000),index INT(10) NOT NULL AUTO_INCREMENT,PRIMARY KEY(index))
I know the other code is correct, because I created another table
previously, and it worked fine. I then copied the code and used it for
this statement.
It's probably a really silly mistake, but I can't figure it out.
Please help. Thanks in advance.
No comments:
Post a Comment