I\'m trying to set up a basic MySQL LIKE search using two search fields. I wan\'t to have it so it\'s multiple optional search fields e.g. if(isset($_POST[\'city\']) || i
if(isset($_POST[\'city\']) || i
HTML
PHP
$w = array(); $where = ''; foreach ($_POST['location'] as $loc){ $loc = mysql_real_escape_string($loc); $w[] = "location = '$loc'"; } if (!empty($_POST['type'])){ $w[] = "type LIKE '%".mysql_real_escape_string($_POST['type'])."%'"; } if ($w) $where = implode(' OR ',$w);