Currently, I need help with my loop. In each div, I want it to show two sets of FirstName and LastName instead of just one set, but I don't know how can I do that because of the loop. Also, the point of setting different font sizes is to create a visual look which is a funnel like shape. My question is, how can I add another set of name per div and is there a better way to code this? can I make my code more efficient?
Edit: Well, I'm mainly trying to figure out how to add another set of name into the div or I can just use another loop. What I mean when I say add another set of name into the div, I mean I want to add another row of data to the div; I want to have the first two rows of data fetched from MySQL in one div.
$state = 1;
$fontcount = 25;
while ($row = mysql_fetch_assoc($result)) {
if( $fontcount == 25 ) { $fontsize = "250%";
} elseif( $fontcount < 25 && $fontcount >= 22 ) { $fontsize = "210%";
} elseif( $fontcount < 22 && $fontcount >= 19 ) { $fontsize = "170%";
} elseif( $fontcount < 19 && $fontcount >= 16 ) { $fontsize = "150%";
} elseif( $fontcount < 16 && $fontcount >= 13 ) { $fontsize = "130%";
} else { $fontsize = "110%";
}
if( $state%2 == 0 ) {
echo "<div style='background-color: #black; font-size: " . $fontsize . "; text-transform:uppercase; text-align:center;'>";
} else {
echo "<div style='background-color: #blue; font-size: " . $fontsize . "; text-transform:uppercase; text-align:center;'>";
}
echo $row['FirstName'] . " " . ' <span style="font-size: 15px;">$' . $row['LastName'] . "</span>";
echo "</div>";
$state++;
$fontcount--;
}