Jump to content

[SOLVED] PHP and MYSQL


mappers

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.