I want to display information when value in listbox selected.
Below is my code:-
This code to get value option in listbox
This code to display information from database when select value in listbox
Anyone can solve my problem? Thanks.
Below is my code:-
This code to get value option in listbox
Code:
<?
$query = "select courseTitle from training where startDate > NOW() ";
$result = mysql_query($query);
print "<SELECT name=item>";
while ($line = mysql_fetch_array($result))
{
foreach ($line as $value)
{
print "<OPTION value='$value'";
}
print ">$value</OPTION>";
}
mysql_close($link);
print "</SELECT>";
?>
Code:
<?
if (isset($_GET['item']))
{
$query=mysql_query ("SELECT training_id from training where courseTitle='$item' ");
while( $row = mysql_fetch_array($query) {
$training_id=$row['training_id'];
echo $row['training_id'];
}
}
?>
Comment