phpretard Posted August 28, 2008 Share Posted August 28, 2008 If I check Residential AND Commercial the correct result displays If I check FHA AND VA the correct result displays If I only check one of the boxes then both entries display. My objective is if I check VA only then the row WHERE VA has the value of "1" should display. Both Database entries have FL for the "Search / State" value. I have attached a snip of the database to help illistrate my problem. /// THE FORM <form action='' method=POST> <input type='checkbox' name='Residential' value='1'> <input type='checkbox' name='FHA' value='1'> <input type='checkbox' name='Commercial' value='1'> <input type='checkbox' name='VA' value='1'> <input type='text' name='Search' size=30> <input type=submit value=Search name=GOSearch> </form> /// THE POST $Residential=$_POST['Residential']; $Commercial=$_POST['Commercial']; $FHA=$_POST['FHA']; $VA=$_POST['VA']; $Search=$_POST['Search']; /// THE QUERY $result = mysql_query("SELECT * FROM members WHERE (State='$Search') AND (Residential='$Residential' OR Commercial='$Commercial' OR FHA='$FHA' OR VA='$VA') ORDER by id"); $num_rows = mysql_num_rows($result); if ($num_rows > 0){ while($row = mysql_fetch_array($result)) { RESULT } } Any help today? [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/121767-solved-exact-match-query/ Share on other sites More sharing options...
phpretard Posted August 29, 2008 Author Share Posted August 29, 2008 Bump Link to comment https://forums.phpfreaks.com/topic/121767-solved-exact-match-query/#findComment-628528 Share on other sites More sharing options...
phpretard Posted August 29, 2008 Author Share Posted August 29, 2008 Is this question not clear? Link to comment https://forums.phpfreaks.com/topic/121767-solved-exact-match-query/#findComment-628536 Share on other sites More sharing options...
phpretard Posted August 29, 2008 Author Share Posted August 29, 2008 So how's it going? Link to comment https://forums.phpfreaks.com/topic/121767-solved-exact-match-query/#findComment-628592 Share on other sites More sharing options...
phpretard Posted August 29, 2008 Author Share Posted August 29, 2008 To answer your question you need a value in the blank field you are comparing them to. Oh Thank you Anthony for your help! Your Welcome. Link to comment https://forums.phpfreaks.com/topic/121767-solved-exact-match-query/#findComment-628596 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.