X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 18F59D1B48D for ; Wed, 7 Jan 2004 19:35:13 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 81712-06 for ; Wed, 7 Jan 2004 15:34:29 -0400 (AST) Received: from gomez.justsportsusa.com (unknown [208.29.195.72]) by svr1.postgresql.org (Postfix) with ESMTP id 92F7FD1B469 for ; Wed, 7 Jan 2004 15:34:22 -0400 (AST) Received: from ehpg.net (gavin.justsportsusa.com [192.168.254.20] (may be forged)) by gomez.justsportsusa.com (8.12.9/8.12.4) with ESMTP id i07JYLWD011929 for ; Wed, 7 Jan 2004 11:34:22 -0800 Message-ID: <3FFC5FA9.6020604@ehpg.net> Date: Wed, 07 Jan 2004 11:36:09 -0800 From: "Gavin M. Roy" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-php@postgresql.org Subject: Re: displaying a rowset in php...same column names References: <71B8A8BEC516CF46835CA629156CF21163F6EE@bedford.idacorp.local> <200312291402.35789.scrawford@pinpointresearch.com> <1073474074.31454.3.camel@skyblue.office.frontsite.com.tr> In-Reply-To: <1073474074.31454.3.camel@skyblue.office.frontsite.com.tr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/4 X-Sequence-Number: 2520 > > >This query: SELECT login, firstname, lastname, date_part('epoch', >lastlogin), date_part('epoch', regdate) FROM admin ORDER BY login >results in: > > login | firstname | lastname | date_part | >date_part > > Another way from assigning column names, if you dont want to do that... instead of pg_Fetch_Object $data = pg_Fetch_Array($result, $row); /* $data[0]: login $data[1]: firstname $data[2]: lastname $data[3]: date_part $data[4]: date_part */ *or* $login = pg_Result($result, 0, 0); $firstname = pg_Result($result, 1, 0); $lastname = pg_Result($result, 2, 0); $date1 = pg_Result($result, 3, 0); $date2 = pg_Result($result, 4, 0); Hope this helps Gavin Enver ALTIN wrote: >On Wed, 2004-01-07 at 05:09, Michael Hanna wrote: > > >>This query: SELECT login, firstname, lastname, date_part('epoch', >>lastlogin), date_part('epoch', regdate) FROM admin ORDER BY login >>results in: >> >> login | firstname | lastname | date_part | >>date_part >> >> > >SELECT foo as bar,bar as foo from footable > >notice the "as" thingie. It would help. > >