I have the following nested repeat region:
$base_phylum = '';
$base_class = '';
$base_order = '';
$base_family = '';
mysql_query......
while($row = mysql_fetch_array($query))
{
// assumes $row['class'] / $row['order'] etc
if($base_phylum !== $row['phylum'])
{
echo $row['phylum'].' ';
$base_class = $row['phylum'];
}
if($base_class !== $row['class'])
{
echo $row['class'].' ';
$base_class = $row['class'];
}
if($base_order !== $row['order'])
{
echo $row['order'].' ';
$base_order = $row['order'];
}
if($base_family !== $row['family'])
{
echo $row['family'].' ';
$base_family = $row['family'];
}
echo $row['species'].'<br />';
}
NOW, I am now trying to design the data display and want to do the following:
- indent each category (without the periods) like:
phylum
.........class
...............order
......................family
.............................species
2.
If, for example, there is no family or order for a particular speciesI would want species to appear indented right under class as follows:
phylum
.........class
...............species
any ideas how I may do this?
Thanks again for your ideas
Jim