co.ador Posted January 3, 2010 Share Posted January 3, 2010 <pre>Array ( [frmSearch] => Array ( [zipcode] => [food_types] => Array ( [0] => 5 ) [submit] => Submit </pre> above is the print_r of the POST global variable coming from page1 in page2 I want to display three fields from table stores based on some condition met with the form values. The thing is that foodtypes input field is an array and I am trying to fit the results of foodtypes inside the query where the fields from table store are to be display. I am trying to script it at the WHERE clause. so far I have this. <?php // Extract the form POST variables and escape them $strZipCode = isset($_REQUEST['frmSearch']['zipcode'])? mysql_real_escape_string($_REQUEST['frmSearch']['zipcode']):''; $arrFoodTypes = isset($_REQUEST['frmSearch']['food_types'])? ($_REQUEST['frmSearch']['food_types']):array(); //query to display three fields from stores based on the form input. $query4 = "SELECT state, zip, county,restaurantname,restaurant_id FROM stores WHERE zip= '$strZipCode' OR restaurantname='$strName' OR state='$strState' OR restaurant_id=". $arrFoodTypes[0].""; ?> the above condition at the WHERE zip is not working help please..... Link to comment https://forums.phpfreaks.com/topic/187023-help-with-a-where-condition/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.