Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move result set curosr back one row

Status
Not open for further replies.

blues77

Programmer
Jun 11, 2002
230
CA
Hello,

I was wondering if there is a PHP function that will allow me to move the result set cursor that I'm using to iterate through a result set back one row so that I can re-read a particular row.

I'm using mysql_fetch_object to retrieve each of the rows and mysql_query($result) so actually execute the query. Any and all help is appreciated.

Thanks
 
there is a method called mysql_data_seek(). take a look at it...

Known is handfull, Unknown is worldfull
 
If you have a specific offset you can use to retrieve the row.
Generally speaking I suspect that the design of your application flow probably could be altered to make such a backtrace lookup superfluous.
 
>>If you have a specific offset you can use

thats what mysql_data_seek does. the defenition says:
mysql_data_seek(resource result_identifier, int row_number)

Known is handfull, Unknown is worldfull
 
vbkris[]/b]
I would expect that result set iteration using a 'cursor' already implies that the current offset is known (cursor - 1).
If not, what you suggest is the way to go.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top