Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

argh! Help needed!

Status
Not open for further replies.

Pr0ject

IS-IT--Management
Jul 8, 2004
7
0
0
US
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.
 
try to put array name for the selector, like <select name=var[]>

if the user choose multiple selection, it will save in array when submit the form.


Thanks
Louis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top