I have a simple SQL query,
SELECT * FROM phones WHERE manu='$manuf' AND price BETWEEN $min AND $max
The issue is that all of the variable fields are connected to fields that will sometimes be empty, and thus I need a way to make them match any value that their respective field could take if they are empty. I tried
$min=$_REQUEST['min_price'];
$max=$_REQUEST['max_price'];
$manuf=$_REQUEST['manufact'];
if (empty($min)){
$min=0;}
if (empty($max)){
$max=900000;}
if (empty($manuf)){
$manuf='*';}
which works ok for the numerical fields (although I don't like having to manually set limits like this), but I can't figure out how to get a universal match for the text field. I thought * would do it since it matches all row names, but apparently not. Anyone know how to do this?