Question
Programmatical unordered lists - PHP
I have this code to write a recordset into adjacent sets of
unordered lists,
each containing 5 list elements -
<ul>
<?php $i=0; do { ?>
<li><a href="p7hg_img_1/fullsize/<?php echo
$row_Recordset1['imgsFilename']; ?>_fs.jpg"><img
src="p7hg_img_1/thumbs/<?php echo $row_Recordset1['imgsFilename'];
?>_tmb.jpg" alt="Gallery: Image" title="" width="100" height="67"></a>
<div><?php echo $row_Recordset1['imgsCaption'];
?></div>
</li>
<?php $i++; if ($i==5) { $i=0; echo '</ul><ul>'; } ?>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</ul>
The problem comes when the looper terminates. I am left with a spare
<ul></ul> pair. How can I manage this?
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
each containing 5 list elements -
<ul>
<?php $i=0; do { ?>
<li><a href="p7hg_img_1/fullsize/<?php echo
$row_Recordset1['imgsFilename']; ?>_fs.jpg"><img
src="p7hg_img_1/thumbs/<?php echo $row_Recordset1['imgsFilename'];
?>_tmb.jpg" alt="Gallery: Image" title="" width="100" height="67"></a>
<div><?php echo $row_Recordset1['imgsCaption'];
?></div>
</li>
<?php $i++; if ($i==5) { $i=0; echo '</ul><ul>'; } ?>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</ul>
The problem comes when the looper terminates. I am left with a spare
<ul></ul> pair. How can I manage this?
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
