set an auto increment counter based on mysql_numrows variable. This will give you the order number of the record.
On Nov 20, 2007 12:34 AM, agneady <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > Is there a simple way of knowing the order of a specific record in a > returned results set without actually retrieving the actual result > set? For example, let's say that I have a query like this: > > select id, name, title from employees where dept=3 > > And let's say that it returns the following data: > > 12, john smith, accountant > 22, john doe, auditor > 43, mary adams, editor > 17, jack smith, consultant > > Now, I'm interested in knowing the order of the record with id=43. So, > is there a query that would return the answer as 3 without actually > returning the entire result set above? > > I need this because sometimes I have queries that might return > thousands of records, and all I need to know is the order of one of > the records, regardless of the contents of any of the records. > > Thank you. > >
