I count the number of rows and then loop through to the total number. But after deleting a couple of rows, it still counts that number even though they don't exist anymore.
Relevant code below:
count:
Code: Select all
$rowTotal = mysql_query("SELECT COUNT(*) FROM slides");
for loop:
Code: Select all
for ($i=1; $i<=$rowTotal; $i++){
$row = mysql_fetch_array($result);
echo "<li><a href=\"?slide=" . $row["pkey"] . "\">" . $i . "</a></li>";
}
Also when echoing out the count, it displays as 5, instead of 3. When doing the the count in MySQL Query Browser, it displays as the correct 3.