[rfc] new getTables Pear DB method
| From: | Tomas V.V.Cox | Date: | Fri, 26 Oct 2001 00:18:03 +0000 |
| Subject: | [rfc] new getTables Pear DB method | ||
| Groups: | php.pear.dev php.pear.general | ||
| Request: | Send a blank email to pear-dev+get-2386@lists.php.net to get a copy of this message | ||
I plan to implement this func for Pear DB (read more about the
initiative in pear-general), to get an array with the tables contained
in the selected database.
## Proto ##
common.php:
array getTables();
drivers:
string _getTablesQuery();
## Implementation (quick) ##
function getTables()
{
return $this->getCol($this->_getTablesQuery);
}
function _getTablesQuery()
{
return "show tables";
}
## Usage ##
$tables_array = $db->getTables();
## More? ##
If you find useful, I could add also a extra param: getTables([bool
$show_rows=false]), that could return also the number of rows per table
when set to true.
Please tell me your ideas or die with that :-).
Tomas V.V.Cox
PS.- This msgs is crossposted in pear-dev and pear-general as there is
the main interest for this.