i have a form with three select boxes that will go to an action page.
bit stuck on the mysql on the php action page. only have one table (test). i need it so that a user can search for either one or two or all three criteria.
i am storing the query in a variable;
$sql = "select fname, lname, city, id_number from test";
have seen that you can append info to the query like the following;
if ($cuisine != "") {
$sql .= " and fname = '$fname'";
};
if ($postcode != "") {
$sql .= " and postcode = '$postcode'";
};
but i can't get it to work. any help would be great!!