timmah1 Posted December 2, 2007 Share Posted December 2, 2007 I have a search form <form action="?cid=search" method="post" name="BarSearch"> <table border="0" cellpadding="2" cellspacing="0"> <tr valign="bottom"> <td height="20" colspan="2" class="palePurple"><strong>Choose location</strong>:</td> </tr> <tr valign="middle"> <td height="30" align="right" class="palePurple">Location</td> <td height="30"> <select name="city" id="city"> <option value="none" selected>Location... <option value="Cleveland">Cleveland</option> <option value="Canton">Canton</option> </select> </td> </tr> <tr valign="bottom"> <td height="20" colspan="2" class="palePurple"><strong> Choose any of the following criteria:</strong></td> </tr> <tr> <td height="30" align="right" valign="middle" class="palePurple">Keyword</td> <td height="30" valign="middle"><input name="field" type="keyword" id="keyword" size="20"> </td> </tr> <tr> <td height="30" align="right" valign="middle" class="palePurple"><nobr>Style</nobr></td> <td height="30" valign="middle"> <select name="style" value="style"> <option value="Bartenders">Bartenders</option> <option value="Lounges">Lounges</option> <option value="Restaurants">Restaurants</option> </select></td> </tr> <tr> <td height="17" align="right" valign="middle" class="palePurple">Amenity</td> <td height="30" valign="middle"> <select name="amenity"> <option selected value="">All</option> <option value="1">ATM</option> <option value="2">Basketball</option> <option value="3">Beach volleyball</option> <option value="4">Big-screen TV</option> <option value="5">Billiards</option> <option value="7">Cigar shop</option> <option value="6">Cigarette vending</option> <option value="8">Cloakroom</option> <option value="9">Dance floor</option> <option value="10">Darts</option> <option value="11">Fireplace</option> <option value="12">Foosball</option> <option value="13">Internet Access</option> <option value="14">Jukebox</option> <option value="15">Limo service</option> <option value="16">Non-smoking area</option> <option value="17">NTN</option> <option value="18">Outdoor seating</option> <option value="19">Pay phone</option> <option value="20">Pinball</option> <option value="21">Pool tables</option> <option value="22">QB1</option> <option value="23">Satellite/cable TV</option> <option value="24">Valet parking</option> <option value="25">Video games</option> <option value="26">VIP lounge</option> </select> </td> </tr> <tr valign="middle"> <td height="24"> </td> <td height="24"> <input type="hidden" name="searching" value="yes" /> <input type="submit" name="search" value="Search" /></a> </td> </tr> </table> </form> I need to be able to check the Location AND Keyword, Style & Amenities at one time. I would like the search to still produce results if they find something in the city, but not the syle, and so forth. I'm having a tough time figuring this out. $data = mysql_query("SELECT * from users WHERE (city like '%city%') OR (keyword like '%keyword%') OR (style like '%style%') OR (amenity like '%amenity%'"); Anybody have any idea? Any suggestions would be extremely helpful. Quote Link to comment 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.