Hi y'all
I've got a PHP function which selects some data from MySQL and then outputs to HTML. Here's what comes out of it currently......
<div class="hot"><span class="yellow_text">23.07.05 NEWS</span><br>New website launch in 2 weeks<a href="#"><br>[more...]</a></div><div class="hot"><span class="yellow_text">20.07.05 FORUM</span><br>Defensive Driving<a href="#"><br>[more...]</a></div>
What I'd like to come out is this:
<div class="hot">
<span class="yellow_text">23.07.05 NEWS</span>
<br>New website launch in 2 weeks<a href="#">
<br>[more...]</a></div>
<div class="hot">
<span class="yellow_text">20.07.05 FORUM</span>
<br>Defensive Driving<a href="#">
<br>[more...]</a>
</div>
my PHP function looks something like this......
while ($hot_data = mysql_fetch_assoc($query)) {
$hot_topics .= '<div class="hot">';
$hot_topics .= '<span class="yellow_text">' . $hot_data['HOT_DATE'];
$hot_topics .= ' ' . $hot_data['SECTION'] . '</span>';
$hot_topics .= '<br>' . $hot_data['TEXT'] . '';
$hot_topics .= '<a href="' . $hot_data['URI'] . '"><br>[more...]</a>';
$hot_topics .= '</div>';
}
return $hot_topics;
How can I get it to format the HTML neatly, not that it really matters but I'm fussy like this!?