When pagination is done, I want to do next and previous links on particular object page
===

I'm working about some listing and gallery in codeigniter with PHP. 
I've done all the searches and good search result page with pagination.

Now when I click on position in my search results list it gets me into page with single result, description etc.

My question is: how to smartly make "next" and "previous"links on this single result page? After clicking next it goes to the page of next result etc.

Is there any other way than storing full search results in some array while browsing?