Forum Moderators: coopster

Message Too Old, No Replies

listbox/dropdown menu load

         

NeilB84

2:15 pm on Apr 28, 2005 (gmt 0)

10+ Year Member



Hi I'm trying to data from a column in a database into a listbox/dropdown menu. The current coding I'm using just displays a blank page rather then the form.

Any idea's of where I'm going wrong?

<html>
<head>
<title>test</test>
</head>

<?

$database ="books";
mysql_connect("localhost","demo","")
or die("Unable to connect to server");
mysql_select_db($database) or die ("Unable to connect to database");

$query = "SELECT DISTINCT ffrom FROM type order by type";

$result = mysql_query($query)
or die ("couldnt execute query.");

echo "<form action='view_specific.php' method = 'post'>
<select name='departure'>\n";

while ($row = mysql_fetch_array($result))
{
extract($row);
echo "<option value='$departure'>\n";

}

echo "</select>\n";

echo "<input type ='submit' value='search'>
</form>\n";

?>

</body>
</html>

ncreegan

2:43 pm on Apr 28, 2005 (gmt 0)

10+ Year Member



on the page that is output, is the data that's echo'd appearing? ie the "<form.."?

NeilB84

2:54 pm on Apr 28, 2005 (gmt 0)

10+ Year Member



Nope nothing is appearing on the page at all.

ncreegan

4:18 pm on Apr 28, 2005 (gmt 0)

10+ Year Member



are you sure your server is set up with php?

NeilB84

5:01 pm on Apr 28, 2005 (gmt 0)

10+ Year Member



Yes, it's got quite a few php pages up and running sucessfully.