Resource id #3? - Mailing list pgsql-novice

From Mark Nelson
Subject Resource id #3?
Date
Msg-id Pine.PMDF.3.96.1021105175415.543181300A-100000@cc.usu.edu
Whole thread Raw
Responses Re: Resource id #3?  (Philip Hallstrom <philip@adhesivemedia.com>)
Re: Resource id #3?  (Josh Berkus <josh@agliodbs.com>)
List pgsql-novice
I guess I'm not getting this, but I'm trying to run an
aggregate function (MAX) on a simple table with PHP. I want
to find the largest id (an integer) and nothing else. It
doesn't matter what is in that row, I just want the largest.
I thought I had it with this:

$maxid = query("SELECT MAX(id) FROM mytable");

// query () is a function that queries the DB with the sql

But when I echo "$maxid"; I get "Resource id #3". That is
not what I wanted. I was hoping I would get "25" or "30" or
whatever the highest number in the 'id' column is. What am I
missing here?

/mark



pgsql-novice by date:

Previous
From: Ciprian Popovici
Date:
Subject: OT: displaying sender's email on archives.postgresql.org
Next
From: Philip Hallstrom
Date:
Subject: Re: Resource id #3?