SyntaxFix
Write A Post
Hire A Developer
Questions
You may be closer than you think — SHOW TABLES already behaves a lot like SELECT:
$pdo = new PDO("mysql:host=$host;dbname=$dbname",$user,$pass); foreach ($pdo->query("SHOW TABLES") as $row) { print "Table $row[Tables_in_$dbname]\n"; }