felito Posted June 24, 2011 Share Posted June 24, 2011 i want to catch the `password` of a specif email when the value of activation is 1 or 2 query that i am using: SELECT password FROM users WHERE email= "mail@gmail.com" && activation=1 OR activation=2 this code catches all emails that have `activation = 2`, but my idea is only catch `mail@gmail.com` if the value of `activation` is 1 or 2. any idea? thanks Quote Link to comment https://forums.phpfreaks.com/topic/240334-problem-with-or/ Share on other sites More sharing options...
Maq Posted June 24, 2011 Share Posted June 24, 2011 You need parentheses: WHERE email= "mail@gmail.com" AND (activation=1 OR activation=2) Quote Link to comment https://forums.phpfreaks.com/topic/240334-problem-with-or/#findComment-1234500 Share on other sites More sharing options...
fenway Posted July 2, 2011 Share Posted July 2, 2011 You should NEVER need to retrieve the password. Quote Link to comment https://forums.phpfreaks.com/topic/240334-problem-with-or/#findComment-1237717 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.