Skip site navigation (1) Skip section navigation (2)

psql with PHP question

From: Jason <gee308(at)mediaone(dot)net>
To: pgsql-php(at)postgresql(dot)org
Cc: pgsql-novice(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: psql with PHP question
Date: 2001-05-03 12:06:25
Message-ID: 3AF149C1.AEC30AA9@mediaone.net (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-novicepgsql-php
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


In response to

Responses

pgsql-novice by date

Next:From: Tod McQuillinDate: 2001-05-03 12:49:14
Subject: Re: psql with PHP question
Previous:From: Andy HowarthDate: 2001-05-03 11:35:24
Subject: Problems compiling 7.1 with TCL support on Solaris 7

pgsql-php by date

Next:From: Tod McQuillinDate: 2001-05-03 12:49:14
Subject: Re: psql with PHP question
Previous:From: Andy HowarthDate: 2001-05-03 11:35:24
Subject: Problems compiling 7.1 with TCL support on Solaris 7

pgsql-general by date

Next:From: Michelle MurrainDate: 2001-05-03 12:39:18
Subject: Re: Perl Scope problem
Previous:From: Andy HowarthDate: 2001-05-03 11:35:24
Subject: Problems compiling 7.1 with TCL support on Solaris 7

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group