Ok i have a drop down box which gets a load of entries from a database and populates the drop down. I then need to print to screen the currently selected option, but on the same page- no going to a new page etc.
$host = "localhost";
$user = "root";
$password = "!";
$database = "rio_test";
$connection = mysql_connect($host,$user,$password)
or die ("Couldn't connect to server.");
$db = mysql_select_db($database, $connection)
or die ("Couldn't select database.");
echo "<select name=\"ticketName\" id=\"ticketName\">";
echo "<option>IPTIS Ticket Name</option>";
$query = "SELECT * FROM new_calculator";
$result = mysql_query($query)
or die ("This entry hasn't been found.");
while($row = mysql_fetch_array($result))
{
$ticket_name = $row['ticket_name'];
echo "<option>$ticket_name</option>";
}
//////// get the 3 lettered codes and return in a drop down box.
echo "</select>";
echo $ticket_name;
Is there a way to do this as I cant figure it out?