If i have a database like this one
[ id - post - num ]
[ 1 P1 1 ]
[ 2 P2 2 ]
[ 3 P3 3 ]
[ 4 P4 5 ]
[ 5 P5 7 ]
Now i have a code like this
$max_number = 7; // AFTER QUERY
$current_number = $_GET['num']; // = 1
if($current_number < $max_number){
echo "<a href='#'>The {$current_number++} in rating Post</a>";
}
the problem in this code that if the topic number is 3 and clicked it would give me number 4 which doesn't exist, Is there a possible way to do it better? using array if possible.