Use SHOW TABLESquery, which returns all table names in database, then create option list:
<?php
mysql_connect('...','...','...');
mysql_select_db('...');
$sql = 'SHOW TABLES';
$result = mysql_query($sql) or die($sql . ' :: ' . mysql_error());
if (mysql_num_rows($result)){
$table_opt = '
<select name="db_table">';
while ($row = mysql_fetch_array($result)){
$table_opt .= '
<option value="' . $row[0] . '">' . $row[0] . '</option>';
}
$table_opt .= '
</select>';
}
echo $table_opt;
?>