I need to get selected option value: Here is my code:
<?php
$conn = mysql_connect("localhost","root","");
if(!$conn)
{
die('Connection refused!'.mysql_error());
}
$dbs = mysql_query("SHOW DATABASES");
echo "<select name=\"dbs_present\">";
$i = 1;
while($res = mysql_fetch_assoc($dbs))
{
echo "<option value=\"$i\">".$res['Database']."</option>";
$i++;
}
echo "</select>";
?>
I can be able to display databases present in mysql in a dropdown using the above code but i unable to get the option which is selected in the dropdown.. How can i get the selected option so that i can display tables present inside that selected database?!