0

So... I received:

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 'key = '48f9f4a3f5e10c63804400f320f46e26'' at line 1

and so I reflected it back to myself, on the webpage and it reads:

SELECT * FROM email_confirm WHERE email = '[email protected]' AND key = '48f9f4a3f5e10c63804400f320f46e26'

I don't see the issue.

MySQL version is 5.1.65-cll

Answer: KEY is a reserved word in mysql. Need backticks !

0

3 Answers 3

1

key is a MySQL keyword. Since it's also the name of your field, enclose it with the appropriate symbols:

SELECT * FROM `email_confirm` WHERE `email` = '[email protected]' AND `key` = '48f9f4a3f5e10c63804400f320f46e26';
Sign up to request clarification or add additional context in comments.

4 Comments

Gotta love it when two people answer 15 seconds apart!
I feel like I should have thought about that more. I thought it, but ignored the thought (and forgot about it). Thank you Anton!
No problem! Don't forget to choose an answer, it helps our reps :)
Had to wait the default 10 mins! Get me some rep too. I'm new to stackoverflow! (Greatly Appreciated)
1

Key is a reserved word. Use backticks to escape it.

... `key` = '48f9...'

1 Comment

And Thank you. Anton appeared first on the page :-\ haha
1

I think key is a reserved word. Use `key` instead.

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.