i have a dopdown menu which shows the list of tables in the database..now i want to dispaly the result of the selected table from the database in the dropdown menu on submit but i am unable to get how to do it,kindly help..
<?
$link= mysql_connect("localhost","root","") or die ("could not connect");
mysql_select_db("creative design") or die("could not Select database");
$sql = "SHOW TABLES";
$result = mysql_query($sql);
$tableNames= array();
while ($row = mysql_fetch_row($result)) {
$tableNames[] = $row[0];
}
?>
<? echo '<select name="tables" id="tables">';
foreach ($tableNames as $name){
echo '<option value="' . $name . '">' . $name . '</option>';
}
echo '</select>';
?>
<input name="sbtn" type="submit" value="update" />