Re: possible to add a "record number" to a query?

From: Date: Thu, 13 Jun 2002 13:30:13 +0000
Subject: Re: possible to add a "record number" to a query?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-101950@lists.php.net to get a copy of this message
On Thursday 13 June 2002 20:27, Jeff Field wrote: > I would like to have a column returned in a query that tells you which > record I'm looking at? Sort of like an auto_increment? IOW, the query > results would look like: > > record first last > > 1 john doe > 2 joe blow > 3 carol fisher > > The table only has first and last, but I want the results to add something > like record to tell me which record it is. Thanks for any help! Is there any reason why you need/want to do this? Data are stored in a db in no particular order. If you want a particular order add an ORDER BY clause. If you want 'row' numbers then just fudge it in php -- assign a row number to each record you retrieve from the query. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* There's such a thing as too much point on a pencil. -- H. Allen Smith, "Let the Crabgrass Grow" */

« previous php.general (#101950) next »