Assuming your current record id is in say, $redID:
SELECT MAX(id) FROM tablename WHERE id < $recID
will give the the previous record, and
SELECT MIN(id) FROM tablename WHERE id > $recID
You could also use something like
SELECT * FROM tablename WHERE id < $recID ORDERBY id DESC LIMIT 1
and
SELECT * FROM tablename WHERE id > $recID ORDERBY id ASC LIMIT 1