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= "[email protected]" && activation=1 OR activation=2 this code catches all emails that have `activation = 2`, but my idea is only catch `[email protected]` if the value of `activation` is 1 or 2. any idea? thanks 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= "[email protected]" AND (activation=1 OR activation=2) 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. Link to comment https://forums.phpfreaks.com/topic/240334-problem-with-or/#findComment-1237717 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.