Slideshow, list of slides - 1,2,3 etc - future proof
Posted: Sat Sep 09, 2006 10:56 am
Hi, i'm doing a slideshow using PHP/MySQL.
I want to have a list of links to skip to certain slides like 1 2 3 4 5
with a link on each one. I know how to do this with a for loop going through the table.
However, if i need to delete the row to get rid of a slide or create an active column and set it to 0, the list ends up looking like this 1 3 4 5.
(if i had made row two inactive)
Here is my current code:
How could i maintain the 1,2,3,4,5 list whilst detecting and not displaying the inactive row???
Any ideas or better ways of doing this most welcome!!! please help!

I want to have a list of links to skip to certain slides like 1 2 3 4 5
with a link on each one. I know how to do this with a for loop going through the table.
However, if i need to delete the row to get rid of a slide or create an active column and set it to 0, the list ends up looking like this 1 3 4 5.
(if i had made row two inactive)
Here is my current code:
Code: Select all
for ($i=1; $i<=$rowTotal; $i++){
$row = mysql_fetch_array($result);
if ($row["active"] == 1){
echo "<li><a href=\"?slide=" . $row["pkey"] . "\">" . $i . "</a></li>";
}
}Any ideas or better ways of doing this most welcome!!! please help!