Received: from hotmail.com (law-f294.hotmail.com [209.185.130.233]) by hub.org (8.10.1/8.10.1) with SMTP id e5885Ub58938 for ; Thu, 8 Jun 2000 04:05:30 -0400 (EDT) Received: (qmail 19141 invoked by uid 0); 8 Jun 2000 08:05:24 -0000 Message-ID: <20000608080524.19140.qmail@hotmail.com> Received: from 195.146.32.200 by www.hotmail.com with HTTP; Thu, 08 Jun 2000 01:05:23 PDT X-Originating-IP: [195.146.32.200] From: "omid omoomi" To: bernie.huang@ec.gc.ca, pgsql-sql@postgresql.org Subject: Re: Fetch an element in an array Date: Thu, 08 Jun 2000 01:05:23 PDT Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Archive-Number: 200006/86 $row = pg_fetch_array($exec, 1); echo $row['col2']; Regards Omid Omoomi >From: Bernie Huang >To: PGSQL-SQL >Subject: [SQL] Fetch an element in an array >Date: Wed, 07 Jun 2000 17:21:52 -0700 > >Hi, > >This is more of a PHP problem, but I wish if someone knows this can help >me. How do I fetch an element in a Postgres array? > >I have a table like > >employee >-------- >col1 int4 >col2 text[] > >now I used the php api > >$row = pg_fetch_array($exec, 0); > >which gives me the following: > >echo $row['col2']; >(prints out ===> {"123-4567", "Bernie", "123-5670"} ) > >(echo $row['col2[2]']; <=== didn't work) > >What can I do to extract only the "Bernie" element? > >Thanks. > > >- Bernie ><< bernie.huang.vcf >> ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com