I have the following PHP code:
$getnews = mysql_query("SELECT * FROM news ORDER BY id DESC") or die(mysql_error());
while ($row = mysql_fetch_assoc($getnews)) {
$id = $row['id'];
$title = $row['title'];
$body = $row['body'];
$date = $row['date'];
echo "<div class=\"title\">$title</div><br>";
echo nl2br($body);
echo "<br><div class=\"date_time\">".time_ago($date)."</div>";
echo "<hr>";
}
This is used to create a news feed and I use echo to print out what is within the updates. Is there a way in which I could maybe use a list to print out each update instead of the way im currently doing it?
Or is it possible to create a div around each update that the while loop creates?
I'm sorry if the question is not clear but thanks for all the help!
My newsfeed creates updates in a news feed like twitter. Each update is printed out using echo and surrounded by
. Im trying to find a way in which I can create a list or div for the entire layout of each update. Im finding very difficult to arrange whats going on in each update.