RE: [PHP] $db_list = mysql_list_dbs
| From: | Kearns, Terry | Date: | Thu, 07 Mar 2002 07:26:55 +0000 |
| Subject: | RE: [PHP] $db_list = mysql_list_dbs | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-87587@lists.php.net to get a copy of this message | ||
Do a select on mysql's system database/table
Mysql.db
There's a column called db and one called user.
Put a where clause on user.
If you want more help, there is a PHP-DB mailing list.
[TK]
> -----Original Message-----
> From: jtjohnston [mailto:jtjohnston@courrier.usherb.ca]
> Sent: Thursday, 7 March 2002 3:31 PM
> To: php-general@lists.php.net
> Subject: [PHP] $db_list = mysql_list_dbs
>
>
> mysql-list-dbs works but displays all databases. How do I
> limit to display those that a user has access rights to?
>
http://www.php.net/manual/en/function.mysql-list-dbs.php
$link = mysql_connect($server, $user, $password);
$db_list = mysql_list_dbs($link);
while ($row = mysql_fetch_object($db_list))
{
echo $row->Database . "\n";
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php