Search with multiple select
I have a form with 2 fields one of which is a multiple select:
<form id="form1" name="form1" method="get" action="wagesList.php"><table>
<tr>
<th>
Select Week:</th>
<td><select name="Week[]" multiple="multiple" id="Week">
<?php
while(!$week->atEnd()) { //dyn select
?>
<option value="<?php echo($week->getColumnVal("Week")); ?>"><?php echo($week->getColumnVal("Week")); ?></option>
<?php
$week->moveNext();
} //dyn select
$week->moveFirst();
?>
</select></td>
<td> </td>
</tr>
<tr>
<th>Travel Expert:</th>
<td><select name="expert" id="expert">
<?php
while(!$expert->atEnd()) { //dyn select
?>
<option value="<?php echo($expert->getColumnVal("TravelExpert")); ?>"><?php echo($expert->getColumnVal("TravelExpert")); ?></option>
<?php
$expert->moveNext();
} //dyn select
$expert->moveFirst();
?>
</select></td>
<td><input name="submit" type="submit" class="managerbutton" id="submit" value="Submit" /></td>
</tr>
</table>
</form>
I am trying to search the database for records that match (both fields are varchar). The expert column is optional, but the Week column has to have a value. This is my code:
<?php
$commission = new WA_MySQLi_RS("commission",$horizon_i,0);
$commission->setQuery("SELECT Commissions.*, Request.TravelExpert FROM Request JOIN Commissions ON Request.ID=Commissions.RequestID WHERE Request.TravelExpert LIKE ? AND Commissions.Week=?");
$commission->bindParam("c", "".$_GET['expert'] ."", "-1"); //colname
$commission->bindParam("s", "".$_GET['Week'] ."", "-1"); //colname1
$commission->execute();
?>
If there is one value submited for 'Week' it works but if multiple are it doesn't. How do I get it to search multiple values?