|
|
 |
FN-FORUM: Choosing the next record in MySQL DB
date posted 14th May 2008 00:18
Hi
I have a simple news page which has its content stored in a DB as separate
articles. When I pull up a news article into this template I want to be able
to show a link to the next news story and the previous one. These are simply
the one with the next highest and next lowest ID (Auto incrementing integer)
But I don't know an easy way to do this without testing each higher and
lower number until I find a valid ID. (Some articles are deleted so there is
not a continuous sequence.
I recall reading something about a corsor which keeps track of where you are
in the table, but cannot find out how to manipulate it to retrieve records.
Any clues?
R
--
m: 07879 405101
t: 0118 375 5259
|
 |
|