Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4EF814765D4 for ; Tue, 3 Sep 2002 13:12:12 -0400 (EDT) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by postgresql.org (Postfix) with ESMTP id 80EDF4765ED for ; Tue, 3 Sep 2002 13:12:10 -0400 (EDT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.4/8.12.4) with ESMTP id g83HAvHn020980; Tue, 3 Sep 2002 11:10:57 -0600 (MDT) Date: Tue, 3 Sep 2002 11:04:29 -0600 (MDT) From: "scott.marlowe" To: Zhidian Du Cc: "pgsql-php@postgresql.org" Subject: Re: How can I get metadate of a table in PHP3? In-Reply-To: <3D71AF16.E4216C05@cs.nmsu.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/8 X-Sequence-Number: 1463 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.