...

View Full Version : Creating a <select> with table names



skilled360
03-30-2007, 07:30 AM
Hi, I was wondering if there is anyway to get all the tables in a mySQL database and insert it into a Drop down box with php, or any other language.

BonRouge
03-30-2007, 08:47 AM
$tables=mysql_list_tables($dbname);
echo "<select>";
$table = 0;
while ($table < mysql_num_rows($tables)) {
$tablename=mysql_tablename($tables, $table);
echo "<option><value=\"$tablename\">$tablename</option>\n\r";
$table++;
}
echo "</select>";

skilled360
03-30-2007, 07:04 PM
Thank you very much BonRouge



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum