View Single Post
Old Apr 7th, 2006, 7:34 AM   #3
Mocker
Hobbyist Programmer
 
Mocker's Avatar
 
Join Date: Oct 2005
Location: Indiana
Posts: 224
Rep Power: 0 Mocker is an unknown quantity at this point
Send a message via AIM to Mocker
might be an easier way, but you could do something like

previous, SELECT * FROM product_table WHERE product_id < var_previousID ORDER BY product_id DESC LIMIT 1


next, SELECT * FROM product_table WHERE product_id > var_previousID ORDER BY product_id ASC LIMIT 1

that should just select one record, either the next greatest product id, or next smallest
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi
freelance scripts - http://ryanguthrie.com/index.html
Mocker is offline   Reply With Quote