//----Show the previous and next articles Article code START----
$sql_former = "select * from article where id<$id order by id desc "; //SQL statement of the previous article. Note that it is in reverse order, because only the first article is used when returning the result set, not the last article
$sql_later = "select * from article where id>$id "; //Next article sql statement
$queryset_former = mysql_query($sql_former); //Execute sql statement
if(mysql_num_rows($queryset_former)){ //Return the number of records and determine whether it is true, and display the result based on this
$ result = mysql_fetch_array($queryset_former);
echo "Previous post
". $result[title]." )){
$result = mysql_fetch_array($queryset_later);
echo "Next article
". $result['title ']."";
} else {echo "There is no next article
";}
?>