PostgreSQL support with PHP needed

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
belliash
Forum Newbie
Posts: 2
Joined: Thu Sep 11, 2008 3:44 pm

PostgreSQL support with PHP needed

Post by belliash »

Hi,

I would like to rewrite some function i have already written that it may work with PgSQL, but i have no idea how to obtain tables list like i have it done for MySQL. The code i have actually written (for MySQL) is available here http://paste.epheket.ath.cx/ae58cd732a.html and i would be really thankful if you could help me with making it working for PgSQL.


Thanks!
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: PostgreSQL support with PHP needed

Post by VladSun »

From http://www.tech-recipes.com/modules.php ... pic&t=1052

[sql]SHOW TABLES (d) = SELECT table_name FROM information_schema.TABLES WHERE table_schema = 'public'  SHOW DATABASES (l) = SELECT datname FROM pg_database;  SHOW COLUMNS FROM TABLE (d TABLE) = SELECT column_name FROM information_schema.COLUMNS WHERE table_name ='table';[/sql]
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply