Deleted MySQL Rows, Count Still Picks Them Up
Posted: Sun Sep 10, 2006 4:29 am
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:
for loop:
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.
Relevant code below:
count:
Code: Select all
$rowTotal = mysql_query("SELECT COUNT(*) FROM slides");Code: Select all
for ($i=1; $i<=$rowTotal; $i++){
$row = mysql_fetch_array($result);
echo "<li><a href=\"?slide=" . $row["pkey"] . "\">" . $i . "</a></li>";
}