Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $dbname = 'mysql_dbname';
- if (!mysql_connect('mysql_host', 'mysql_user', 'mysql_password')) {
- echo 'Could not connect to mysql';
- exit;
- }
- $sql = "SHOW TABLES FROM $dbname";
- $result = mysql_query($sql);
- if (!$result) {
- echo "DB Error, could not list tables\n";
- echo 'MySQL Error: ' . mysql_error();
- exit;
- }
- while ($row = mysql_fetch_row($result)) {
- echo "Table: {$row[0]}\n";
- }
- mysql_free_result($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement