I’m just trying to follow the book"Build Your Own Database Driven Web Site Using PHP & MYSQL" by Kevin Yank 4th Edition.
I’m just at the point of trying to create tables within the MySQL console using WAMP.
The MySQL Version is: 5.6.17 MySQL Community Server
Page 61 states:
Creating a Table
Using the following
mysql> CREATE TABLE table_name (
→ column1Name column1Type column1Details,
→ column2Name column2Type column2Details,
→
→ DEFAULT CHARACTER SET charset;
But when I enter this in to the console I get the following:
ERROR 1064 (42000): 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 ‘column1Type column1Details, column2Name column2Type column2Details,
DEFAULT CHAR’ at line 2
I’ve tired this many times but still get the same issue, can anyone please advise where I’m going wrong?
From the look of the error message you entered the query exactly as shown rather than what it meant.
That is, “table_name” should be the name of the table, “column1Name” should be the name of the first column, “column1type” should be the type of the column, etc. (“place holders”, as it were)
There is no type “column1type” so it threw a syntax error.
That makes sense, I just couldn’t see it at that time of night haha.
The book threw me a bit because previously it had me viewing the databases within MySQL and then deleting them using the console but never explained that we were not still using the console.