From http://stackoverflow.com/questions/1446821/how-to-get-next-previous-record-in-mysql