Re: How can I get metadate of a table in PHP3?

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Zhidian Du <zdu(at)cs(dot)nmsu(dot)edu>
Cc: "pgsql-php(at)postgresql(dot)org" <pgsql-php(at)postgresql(dot)org>
Subject: Re: How can I get metadate of a table in PHP3?
Date: 2002-09-03 17:04:29
Message-ID: Pine.LNX.4.33.0209031102370.7685-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

On Sun, 1 Sep 2002, Zhidian Du wrote:

> Hi:
>
> How can I get metadate of a table in PHP3?

I haven't driven PHP V3 since V4 came out, so I'm not sure if these are
supported, but try these commands:

pg_field_name()
pg_field_type()

You can do a "select * from table limit 1" to get a sample row. Then use
pg_num_rows() to find out how many rows you have and iterate the name and
type functions over each field to find out.

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-09-04 03:23:42 Re: fastest way to retrieve data
Previous Message knut.suebert 2002-09-02 19:44:13 Re: How can I get metadate of a table in PHP3?