Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f47ClfA62747 for ; Mon, 7 May 2001 08:47:41 -0400 (EDT) (envelope-from pgsql-general-owner@postgresql.org) Received: from mclean.mail.mindspring.net (mclean.mail.mindspring.net [207.69.200.57]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f43CVEA28560; Thu, 3 May 2001 08:31:15 -0400 (EDT) (envelope-from gee308@mediaone.net) Received: from comm2.tcgfinancial.net (user-2ive1a8.dialup.mindspring.com [165.247.5.72]) by mclean.mail.mindspring.net (8.9.3/8.8.5) with ESMTP id IAA25134; Thu, 3 May 2001 08:31:07 -0400 (EDT) Received: from mediaone.net (IDENT:root@comm2 [127.0.0.1]) by comm2.tcgfinancial.net (8.9.3/8.9.3) with ESMTP id IAA17776; Thu, 3 May 2001 08:06:25 -0400 Message-ID: <3AF149C1.AEC30AA9@mediaone.net> Date: Thu, 03 May 2001 08:06:25 -0400 From: Jason X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-php@postgresql.org CC: pgsql-novice@postgresql.org, pgsql-general@postgresql.org Subject: psql with PHP question References: <3AF1427C.B4E85A45@is3-design.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200105/296 X-Sequence-Number: 9056 Hi, I want to try and optimize my calls to postgreSQL from PHP. If I only need one field from a select statement, what should I use? I am currently using: $q = pg_Exec("SELECT id FROM article WHERE id=(SELECT MAX(id) FROM article)"); $maxid = pg_fetch_array($q, 0); echo "The highest id is ". $maxid[0]; What can I use besides an array to get a single value? In general, using a single variable always saves more memory than using an array? Thank you. Jason