Hey Guys!
I've ran into a little problem and I've become confused and its doing my head in, even though I consider it as something trivial. My problem is that I'm creating a drop down menu, but would like to have an 'All' option, that would display all the results from the other options (fetches the required data from the database). I've practically ran out of ideas and I would like to here what you guys could suggest. Thanks in advance!
PHP Code:
<select name="season"><?php
$physios=array( "All" => "All employees",
"Chefs" => "Chefs",
"Wait" => "Wait" );
foreach ($physios as $v => $d) {
print "<option value=\"$v\"";
if (isset($_GET['sea']) && $_GET['sea'] == $v) {
print ' selected="selected"';
}
print ">$d</option>\n";
}
?></select>
SQL Query:
$query = "SELECT empl_id, year, position, name, yel, rel
FROM played
WHERE empl_id=? AND position=? AND year=? AND (yel=? OR rel=?)
ORDER BY name DESC";