Omdanne valgbar menu til fast udtræk
Hej,Vidste ikke helt hvad jeg skulle kalde dette, men jeg har en dropdown menu der trækker noget data ud af min database hvis de enkelte undermenuer bliver valgt. Nu vil jeg gerne have en side der trækker disse data ud automatisk uden at skulle vælges først.
Koden hedder (menuen):
<select onchange="location = 'top.php?id=' + this.options[this.selectedIndex].value;">
<option value="">-- Select List --</option>
<option value="Goalkeeper" <?=$_GET[id]=="Goalkeeper"?'selected="selected"':'';?>>Goalkeeper</option>
<option value="Defender" <?=$_GET[id]=="Defender"?'selected="selected"':'';?>>Defender</option>
<option value="Midtfielder" <?=$_GET[id]=="Midtfielder"?'selected="selected"':'';?>>Midtfielder</option>
<option value="Attacker" <?=$_GET[id]=="Attacker"?'selected="selected"':'';?>>Attacker</option>
</select>
<h2>: : Top 10 <?=$_REQUEST[id];?> : : </h2>
<?
/* if ($_REQUEST["player_id"]) {
$strSQL = "SELECT * " .
" FROM sternberg_player " .
" WHERE player_id = " . $_REQUEST["player_id"] . " ";
$rsPlayer=DBExecuteRS($strSQL);
$rowPlayer= DBFetchArray($rsPlayer);
} //end if ($_REQUEST["player_id")
*/ ?>
<table border=1 align="center">
<tr bordercolor="#333333" bgcolor="#CCCCCC" class="judultabel">
<td><div align="center" class="textbiasa"><strong>Rank</strong></div></td>
<td><div align="center"><strong>Player Name</strong></div></td>
<td><div align="center"><strong>Score</strong></div></td>
</tr>
<?
$strSQL = "SELECT `player_id` AS `top_player_id` " .
" , `name` ".
" , `age` ".
" , `club_id` ".
" , `position` ".
" , `nationality` ".
" , (SELECT AVG(`rating`) FROM `sternberg_matchrating` WHERE `player_id`=`top_player_id`) as `average` ".
" FROM `sternberg_player` " .
" WHERE `position` = '$_REQUEST[id]' ".
" ORDER BY `average` DESC LIMIT 10";
$rsTop=DBExecuteRS($strSQL);
while ($rowTop=DBFetchArray($rsTop)) {
$i++;
echo ($i % 2) ? "<tr class=oddRow>" : "<tr class=evenRow>";
?>
<td>
<div align=center>
<?=$i;?>
</div>
</td>
<td>
<a href="viewPlayer.php?id=<?=$rowTop["top_player_id"];?>">
<?=$rowTop["name"]?$rowTop["name"]:" ";?>
</a>
</td>
<td>
<?=$rowTop["average"]?round($rowTop["average"],2):"0";?>
</td>
<tr>
<?
} //end while
?>
</table>
</div>
</td>
</tr>
</table>
</div>
Er det muligt at lave om således at det kun er Goalkeeper der vises?