Made a search:
- Title:
- City:
- Address:
And then the criterion of the enterprise, what you need to find. It goes like a checkbox.
function ext($text) { return mysql_real_escape_string(htmlspecialchars($text)); } if($_POST['title']!='') $title=ext($_POST['title']); else $title=''; if($_POST['street']!='') $street=ext($_POST['street']); else $street=''; if($_POST['city']!='') $city=ext($_POST['city']); else $city=''; if(isset($_POST['wifi'])) $prefix1='1'; else $prefix1=''; if(isset($_POST['bil'])) $prefix2='1'; else $prefix2=''; if(isset($_POST['sush'])) $prefix3='1'; else $prefix3=''; if(isset($_POST['kal'])) $prefix4='1'; else $prefix4=''; if(isset($_POST['kar'])) $prefix5='1'; else $prefix5=''; if(isset($_POST['nal'])) $prefix6='1'; else $prefix6=''; $db = mysql_query("SELECT * FROM tb_users WHERE street_cafe LIKE '$street' or name_cafe LIKE '$title' or city_cafe LIKE '$city' or prefix1 LIKE '$prefix1' or prefix2 LIKE '$prefix2' or prefix3 LIKE '$prefix3' or prefix4 LIKE '$prefix4' or prefix5 LIKE '$prefix5' or prefix6 LIKE '$prefix6'");
How do I shorten it? And make the search normal. The result of the work works only on the street name of the city, and with the criteria of the problem. Help solve the issue. Searches for only one parameter.