Just a quick answer without doing much research.
Have a look at the system tables. There is a switch in psql (can't
remember which one) to monitor the actual sql sent to the back-end.
Start with \dS to list the system tables.
Try SELECT * FROM pg_database; to get the databases
I think template1 always exists, so you can try connecting to that if
you're not sure where to start.
I'm not sure how to get the tables, but I'm sure it's the same process.
Ciao
--Louis <louis@bertrandtech.on.ca>
Louis Bertrand http://www.bertrandtech.on.ca/
Bertrand Technical Services, Bowmanville, ON, Canada
Tel: +1.905.623.1500 Fax: +1.905.623.3852
OpenBSD: Secure by default. http://www.openbsd.org/
On Wed, 1 Nov 2000, magnus wrote:
> Hello,
> Can anyone tell me how to list (1.) databases and (2.) tables in a
> database using php?
> Thanks,
> Magnus Lawrie
>