I have a form that has about 4 drop downs and check boxes.
When I submit these selections I have to do a series of if then else to find out which of the options have been selected. This can be quite long as the user can choose either 1, none or any number of options.
Is there a way to store thes responses in some kind of array so that I do not have to manually check them. That way I can run" select data from table where key(array) = array(key)..something like that.
Is there a better way of doing what I have in mind?
sample code
When I submit these selections I have to do a series of if then else to find out which of the options have been selected. This can be quite long as the user can choose either 1, none or any number of options.
Is there a way to store thes responses in some kind of array so that I do not have to manually check them. That way I can run" select data from table where key(array) = array(key)..something like that.
Is there a better way of doing what I have in mind?
sample code
Code:
if (($selfac =='F' and $selrank =='R'))
{
$result = mysql_query("select * from tbl_faculty");
}
else {
if ($selfac != 'F' and $selrank!='R')
{
$result = mysql_query("select * from tbl_faculty where fac_name = '$selfac' and rank= '$selrank'");
}
else {
$result = mysql_query("select * from tbl_faculty ");
}}