Re: record position

From: Date: Thu, 18 Nov 2004 18:23:54 +0000
Subject: Re: record position
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15648@lists.php.net to get a copy of this message
On Thu, 18 Nov 2004 11:17:36 -0500, Jeff Jordan <jjordan@sc.rr.com> wrote: > I am selecting a specific record using Select * where username="javier". > What is the best way to extract the relative position of javier in the > table. Say it is the 50 record of 150, after the fetch_array is there a > mysqli_ that will tell me it was the 50th record? > There's no way to do this. When you run a "select" you get only the records back you asked for. In addition, the DB doesn't keep track of "where" a record is physically. In fact, it could move them around at any time. Sounds like you're looking for an auto_increment primary key. This would tell you approximately how many records had been inserted before the one you got. -- Justin Patrin

« previous php.pear.general (#15648) next »