I have 3 drop down fields that will allow my users to select ANY or ALL, then upon submit they results will get displayed.
I need to figure out how the backend will handle the selections a user chooses...
So far, I have this which works so long as only ONE option is selected. It seems all i need now is a way to include an AND statement if more than one option is selected.
$sql = "SELECT * FROM present";
if (($type != ""
|| ($price != ""
|| ($state != ""
) $sql .= " WHERE ";
if (($type != ""
) $sql .= "Type = '$type' ";
if (($price != ""
) $sql .= "Price $price ";
if (($state !="" )) $sql .= "Location = '$state' ";
Any suggestions? Give me a hollar at pr0ject-at-reject.org.
Thanks.
I need to figure out how the backend will handle the selections a user chooses...
So far, I have this which works so long as only ONE option is selected. It seems all i need now is a way to include an AND statement if more than one option is selected.
$sql = "SELECT * FROM present";
if (($type != ""
if (($type != ""
if (($price != ""
if (($state !="" )) $sql .= "Location = '$state' ";
Any suggestions? Give me a hollar at pr0ject-at-reject.org.
Thanks.