Jump to content

Echo databases


p.ross

Recommended Posts

are you trying to print mysql_query? you have to use mysql_result or mysql_fetch_xxx to get the rows before printing.

 

the php alternative is mysql_list_dbs

<?php

$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');

$db_list = mysql_list_dbs($link);

 

while ($row = mysql_fetch_object($db_list)) {

echo $row->Database . "\n";

}

?>

Link to comment
https://forums.phpfreaks.com/topic/2989-echo-databases/#findComment-10035
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.