Eggzorcist Posted August 19, 2010 Share Posted August 19, 2010 I'm trying to do a query as such: SELECT * FROM projects WHERE user = {$user} and $user = a secured email. but I'm getting this error: 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 '@gmail.com' at line 1 Why am I getting this error? Thank you very much! Quote Link to comment https://forums.phpfreaks.com/topic/211189-mysql-emails/ Share on other sites More sharing options...
DavidAM Posted August 19, 2010 Share Posted August 19, 2010 If the user column is not a number type, you have to put the string you are looking for in quotes: SELECT * FROM projects WHERE user = '{$user}' Quote Link to comment https://forums.phpfreaks.com/topic/211189-mysql-emails/#findComment-1101284 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.