Monday, August 5, 2013

Cakephp blog tutorial, SQL error when INSERTING into posts.

Hi guys, this is my first attempt at CakePHP and so far it seems amazing. I'm not a PHP/DB pro but I am learning. 

Anyway, I'm familiarizing myself with the framework by creating the blog in the tutorial. So far I've successfully created the table, now I am trying to *INSERT INTO POSTS* exactly as it is in the manual:


INSERT INTO posts (title,body,created)
    VALUES ('The title', 'This is the post body.', NOW());
INSERT INTO posts (title,body,created)
    VALUES ('A title once again', 'And the post body follows.', NOW());
INSERT INTO posts (title,body,created)
    VALUES ('Title strikes back', 'This is really exciting! Not.', NOW());

It immediately outputs the following error:

Error
SQL query:
INSERT INTO posts( title, body, created ) 
VALUES (
'The title', 'This IS the post body.', NOW( )
);
MySQL said: Documentation
#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 'title’, ’This is the post body.’, NOW())' at line 2 



I am now stuck because I do not see what's wrong here. While my SQL is limited, it looks correct.. can anyone see what could be causing this error?


Here's the database info:

Apache/2.2.22
Database client version: libmysql - 5.1.66


Thank you for any help!!

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: