Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear
SHOW DATABASES; SHOW TABLES FROM performance_schema ;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php $db_query = "SHOW DATABASES;"; $db_result = $mysqli->query($db_query); if ($db_result && $db_result->num_rows > 0) { while ($row = $db_result->fetch_assoc()) { $dbName = $row["Database"]; echo "\n------------------------------\n"; echo "$dbName:\n"; // Skip certain system databases if (in_array(trim($dbName), ["d3ea000792458c700b3b4529b8117faf", "performance_schema"])) { continue; } $table_query = "SHOW TABLES FROM `$dbName`;"; $table_result = $mysqli->query($table_query); if ($table_result && $table_result->num_rows > 0) { while ($tb_row = $table_result->fetch_assoc()) { $tableName = array_values($tb_row)[0]; echo "$tableName\n"; } } echo "---------------------------\n"; } } $mysqli->close(); ?>
Copy Clear