Re: DB::MySQL

From: Date: Mon, 10 Jun 2002 18:01:35 +0000
Subject: Re: DB::MySQL
References: 1 2 3 4 5  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-6898@lists.php.net to get a copy of this message
At 17:28 +0200 6/10/02, Tomas V.V.Cox wrote:
El lun, 10-06-2002 a las 16:44, Paul DuBois escribió:
At 15:49 +0200 6/10/02, Uli Suppa wrote:
yes, it would.
I suggest that it wouldn't. mysql_list_dbs() should be avoided, because it's deprecated.
In the manual I see that what is deprecated is mysql_listdbs() not mysql_list_dbs(). Are you sure it is deprecated?
Yes. One is an alias for the other. php_mysql.c says: PHP_FALIAS(mysql_listdbs, mysql_list_dbs, NULL) And mysql_list_dbs() calls the function of the same name in the MySQL C API, which has been deprecated since MySQL 3.22.0. The preferred thing to do is run a SHOW DATABASES query.
Anyway, it requires that you be connected in the first place, and if you have to select a database in order to connect, it doesn't really solve the problem.
PEAR DB does not require a database for the MySQL driver, see the connect function.
Better to not require a database to be specified. Not just for getting a list of databases, but also in case you want something like other forms of server metadata (VERSION(), for example). There's no need for a database in such instances.
The problem is that other backends needs the database to connect to at connection time. Don't forget that we are talking about an abstraction layer, not a OO isolated interface for MySQL. Tomas V.V.Cox -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pear.dev (#6898) next »