Resource id #3?

From: Mark Nelson <mcn(at)cc(dot)usu(dot)edu>
To: pgsql-novice(at)postgresql(dot)org
Subject: Resource id #3?
Date: 2002-11-06 01:00:16
Message-ID: Pine.PMDF.3.96.1021105175415.543181300A-100000@cc.usu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Philip Hallstrom 2002-11-06 01:36:16 Re: Resource id #3?
Previous Message Henshall, Stuart - Design & Print 2002-11-05 14:14:20 Re: List sequence assigned to primary key