mappers Posted May 28, 2007 Share Posted May 28, 2007 I am still learning PHP and am a bit stuck. I'm working on a site which has several hundred articles stored in a MySQL database. On the bottom of the page are two links for the previous and next article. The site has been constructed in such a way that the database has fields containing the url of the previous and next pages (i.e. article.php?recordID=137) and these are pulled out of the DB in the form of links. Rather than them having to add this to the DB every time a new article is added I'm trying to automagically do it in PHP. I've sorted the main part by taking the current article and either subtracting or adding it's ID by 1 to create the prev and next but I'm a bit stuck when it comes to the current (highest) article number. What I want it to do is link to an index page when there is no +1 (or -1 for the start). Can anyone help Thanks Link to comment https://forums.phpfreaks.com/topic/53327-solved-php-and-mysql/ Share on other sites More sharing options...
trq Posted May 28, 2007 Share Posted May 28, 2007 Sounds to me like your looking for record paging, This seems a decent tutorial on the subject. Link to comment https://forums.phpfreaks.com/topic/53327-solved-php-and-mysql/#findComment-263552 Share on other sites More sharing options...
mappers Posted May 29, 2007 Author Share Posted May 29, 2007 Sounds to me like your looking for record paging, This seems a decent tutorial on the subject. I think that should sort out my problem. thanks Link to comment https://forums.phpfreaks.com/topic/53327-solved-php-and-mysql/#findComment-263583 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.