I'm trying to create one function to do a lot of different sorting. Can I make the default value of a WHERE argument equal to anything? So that the default value for that argument will find everything?
function get_inventory ($order = 'id', $location = 'WA', $recalls = 'anything', $sold = '0') {
$query = "SELECT * FROM v_inventory ";
$query .= "WHERE location = '{$location}' and ";
$query .= "recalls = '{$recalls}' and ";
$query .= "sold = '{$sold}' ";
$query .= "ORDER BY {$order} ASC";
$result = mysql_query($query, $connection);
}