you would need to hand code this manually in the results set.
the basic gist of the code would use a counter that you increment inside of the loop, if it equals five start a new div:
something like:
<?php $count=1; ?>
<?php if($count==1) { ?>
<div>
<ul>
<?php } ?>
<?php do {
<li><?php echo $row_rsname['column']; ?></li>
<?php $count ++; ?>
<?php if($count==6) { ?>
<?php $count=1; ?>
</ul>
</div>
<?php } ?>
<?php } while ($row_rsname = mysql_fetch_assoc($rsname)); ?>
This is just the basic idea, you may need to adjust the code to get the specific results you are looking for.