select og mysql
Hejsa.Hvordan får jeg nedenstående til at virke.
Jeg går udfra at jeg skal have et kald ind i onchange='', men hvilket, eller er der en anden måde at gøre dette på.
Jeg er godt klar over at jeg have $sql = $_POST["view"]; bygget ind i en if sætning, for ikke at få fejl ved load.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql = $_POST["view"];
$result=mysql_query($sql) or die('Kan ikke vælge bådpladser');
?>
<table width="700" border="0" align="center">
<tr>
<td colspan="3" height="15"></td>
</tr>
<tr>
<td></td>
<form name="vælg" method="post">
<td ><select name="view" size="1" onchange="" >
<option value="SELECT * FROM berth ORDER BY Berth LIMIT 0 , 50">Bro 2 nordside</option>
<option value="SELECT * FROM berth ORDER BY Berth LIMIT 50 , 50">Bro 2 sydside</option>
<option value="SELECT * FROM berth ORDER BY Berth LIMIT 100 , 50">Bro 3 nordside</option>
<option value="SELECT * FROM berth ORDER BY Berth LIMIT 150 , 50">Bro 3 sydside</option>
<option value="SELECT * FROM berth ORDER BY Berth LIMIT 200 , 50">Bro 4 nordside</option>
<option value="SELECT * FROM berth ORDER BY Berth LIMIT 250 , 50">Bro 4 sydside</option>
<option value="SELECT * FROM berth ORDER BY Berth LIMIT 300 , 50">Bro 5 nordside</option>
<option value="SELECT * FROM berth ORDER BY Berth LIMIT 350 , 50">Bro 6</option>
<option value="SELECT * FROM berth ORDER BY Berth LIMIT 400 , 50">Overgange</option>
</select>
</td>
</form>
Finn
