Ok i am having a problem browsing from article to article when i delete an article from the database.
id= auto increment, and $row-1 works fine, but when i delete an article in the database lets say id 5, if i am looking at article id 6 and want to go to the previous data entry, it will go to id5 even though it no longer exists.
My query is as follows
$query = mysql_query("select * from article
where id = '$_GET['ID']'");
This displays all the data for my article. If i wish the user to navigate to the previouse article i have a previous / next button
as you have seen
<a href="view_article.php?id=<?php $previousarticle=($_GET['ID']-1);
echo $previousarticle;?>">previous</a>
<a href="view_article.php?id=<?php $nextarticle=($_GET['ID']+1);
echo $nextarticle;?>">next </a>
problem is, if i am viewing article C, i deleted article B so if i press the previous link i want it to go to article A and not B $_GET['ID']-1 seems to be an incorrect command
Hah i suck at explaining things 😛