note 13660 added to ref.pgsql.php
| From: | passion at php2 dot chek dot com | Date: | Wed, 27 Jun 2001 22:53:30 +0000 |
| Subject: | note 13660 added to ref.pgsql.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-14699@lists.php.net to get a copy of this message | ||
I've tried to mimic the following mysql database connection functions for postgres.
http://www.php.net/manual/en/function.mysql-list-dbs.php
http://www.php.net/manual/en/function.mysql-list-tables.php
These are assuming that you're passing in $link as the result from pg_connect:
function pg_list_dbs($link)
{
$sql = 'SELECT datname FROM pg_database';
return (pg_exec($link, $sql));
}
function pg_list_tables($link)
{
$sql = "SELECT relname FROM pg_class WHERE relname !~ '^pg_'";
return (pg_exec($link, $sql));
}
http://www.php.net/manual/en/ref.pgsql.php