Just starting with php and have MAMP installed on my Mac. I’m using this Sitepoint book:
I’m following the exercise where you create your first table via the terminal. Ive followed the instructions exactly and everything is fine until I type this into terminal:
CREATE TABLE joke (
-> id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> joketext TEXT,
-> jokedate DATE NOT NULL
-> ) DEFAULT CHARACTER SET utf8;
…which is taken from the exercise in the book.
Unfortunately, I get this error:
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 ‘-> id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> joketext TEXT,
-> joke’ at line 2
why? I really am completely new to this so please try to dumb down your answers a bit!
Thanks