0
INSERT INTO `5` VALUES ('photo', 'headline', 'LA Lakers', 'http://facebook.com/NUMBER', 'Here\'s video from the An...', 'NUMBER', 'http://www.facebook.com/NUMBER/posts/NUMBER', 'NUMBER'), 'https://graph.facebook.com/NUMBER/picture?access_token=AAAGGhZBZB1ZCf4BAD1fNpORWVGtWhUI5u**********************&type=normal')

I get this error when I try this query:

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 ''https://graph.facebook.com/NUMBER/picture?access_token=AAAGGhZBZB1ZC' at line 1

after the individual values (NOT the whole query) have been escaped by php function mysql_real_escape_string.

I have changed all profile ids to the string NUMBER and i added the asterisks to the access token to protect my privacy. Those are not usually there.

1
  • 3
    Your last value is outside the brackets Commented Jul 26, 2012 at 18:39

3 Answers 3

1

Try this; the last parameter was outside of the parenthesis.

INSERT INTO `5` VALUES ('photo', 'headline', 'LA Lakers', 'http://facebook.com/NUMBER', 'Here\'s video from the An...', 'NUMBER', 'http://www.facebook.com/NUMBER/posts/NUMBER', 'NUMBER', 'https://graph.facebook.com/NUMBER/picture?access_token=AAAGGhZBZB1ZCf4BAD1fNpORWVGtWhUI5u**********************&type=normal')
Sign up to request clarification or add additional context in comments.

2 Comments

I was missing it could've sworn you were right... Nope! Thats not the problem.
Wait... oops. I've been stairing at this for hours. You are correct. Thank you so much!
0

You forgot the round brackets in the last value of your insert query...
Further, use apostrophe in the table name...
Like this:

INSERT INTO '5' VALUES ('photo', 'headline', 'LA Lakers', 'http://facebook.com/NUMBER', 'Here\'s video from the An...', 'NUMBER', 'http://www.facebook.com/NUMBER/posts/NUMBER', 'NUMBER', 'https://graph.facebook.com/NUMBER/picture?access_token=AAAGGhZBZB1ZCf4BAD1fNpORWVGtWhUI5u**********************&type=normal')

Comments

0

INSERT INTO5VALUES (...), 'https://graph.facebook.com/NUMBER/picture?access_token=AAAGGhZBZB1ZCf4BAD1fNpORWVGtWhUI5u**********************&type=normal'

Take a look at your brackets, they end prematurely, which may be the error.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.