Wow, that's totally right. I sometimes do get caught up in the code and lose track of what I am actually saying in my algorithm. Thanks for the help understanding that! Loop control is hard for me to understand for some reason...
Ok, I think I have one last problem on this page that I don't even know the correct operation to complete. I need to make a variable controlled rowspan for the cells that contain just building information so that it can span the whole vertical distance that is taken up by the list of vacant units. The lowest i want the rowspan is 6, and if there are more vacant units in a building than 6, I want the rowspan to equal that. So I think I have this part right so far:
$mysqlcounter = ?????????
if ($mysqlcounter <= '6') {
$counter = '6';
} else {
$counter = $mysqlcounter;
}
Then I can call it at:
if ($building != $curr_building) {
if (!is_null($curr_building)) {
echo '</tr>' . "\n";
echo '</tbody>' . "\n";
}
echo '<tbody class="' . $color_switch . '">' . "\n";
echo '<tr>' . "\n";
echo '[COLOR=Red]<td rowspan="6"[/COLOR] width="155px"><a href="' . $ROOT . '/' . $row['href'] . '" title="View complete information"><img src="' . $ROOT . '/images/' . $row['picture'] . '" class="listingpic" width="140" height="105"></a></td>' . "\n";
echo '[COLOR=Red]<td rowspan="6">[/COLOR]' . "\n";
So now my problem seems to be: How do I count the number of vacant units that belongs to a building, and then call that as a variable, and still have it repeat for each building and keep everything straight? I have been trying to pour over the PHP and MySQL manuals, so don't scream RTFM quite yet 😃, but there are so many operators and functions that it is hard to find anything even remotly resembling what I think I need.