I have a database of show titles. I need to populate the list of a list box. This I have done using Dreamweaver after many failed attempts to do it on my own. This is working fine.
I now need to be able to pass the selected show title that is chosen by the user and have it link to a new php page that will subsequently pull the rest of the data about that show out of the database and display it. I'm going out of my mind trying to get this to work and can't seem to. I have tried urlencode() and it doesn't seem to work. Any help would be greatly appreciated.
When I select an item from the list it stays at that item but does not go to the other php page, let alone take the value with it.
Thanks,
Andy
Here's the code:
<?php require_once('Connections/KidsNightOnBroadway.php'); ?>
<?php
mysql_select_db($database_KidsNightOnBroadway, $KidsNightOnBroadway);
$query_Broadway_Shows = "SELECT shows.showName FROM shows WHERE shows.show='1' ORDER BY shows.broadwayOffbroadway, shows.sortName";
$Broadway_Shows = mysql_query($query_Broadway_Shows, $KidsNightOnBroadway) or die(mysql_error());
$row_Broadway_Shows = mysql_fetch_assoc($Broadway_Shows);
$totalRows_Broadway_Shows = mysql_num_rows($Broadway_Shows);
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="showShow.php">
<select name="select">
<option value="showShow.php">Select a Show...</option>
<?php
do {
?>
<option value=urlencode("showShow.php?showName=<? echo $row_Broadway_Shows['showName']?>"><? echo $row_Broadway_Shows['showName']?></option>
<?php
} while ($row_Broadway_Shows = mysql_fetch_assoc($Broadway_Shows));
$rows = mysql_num_rows($Broadway_Shows);
if($rows > 0) {
mysql_data_seek($Broadway_Shows, 0);
$row_Broadway_Shows = mysql_fetch_assoc($Broadway_Shows);
}
?>
</select>
</form>
</body>
</html>
<?php
mysql_free_result($Broadway_Shows);
?>