To insert the comment you'll have to know to which blog entry it belongs.
To insert a comment for entry with id=2, use:
INSERT INTO cms.comments(blog_id, name,email,comments_body) VALUES (2, 'theName', 'theMail', 'theComment' );
You cannot use a WHERE clause in an INSERT statement.
smantscheff
Nearly a Posting Virtuoso
1,233 posts since Oct 2010
Reputation Points: 300
Solved Threads: 254
You can't use a WHERE clause with an INSERT statement. You are inserting a new row so matching on a WHERE clause makes no sense. As a blog can have many comments searching in the comments table by blog_id isn't a good idea anyway (except for SELECT of course but you wouldn't want to do that with an UPDATE).
hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 167
Your blog_id will need to be inserted, most probably from a variable that you have stored on the page. The name you give it is up to you. We were both just saying that your SQL statement was incorrect in including a WHERE clause.
hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 167