I have the following code that works fine:
<div class = "wrapper-blog-display">
<div class = "blog-display-title">A TitleA TitleA TitleA</div>
<div class = "blog-display-postedby">A name</div>
<div class = "blog-display-post"> A long post about something blah blah blah etc</div>
<div class = "blog-display-post-readmore"><a href = "a-file.php">Read More</a></div>
</div>
It displays a blog post, however naturally i need to have this work dynamically so i made the following code:
<?php
include ('connect.php');
$qry = ('SELECT * FROM blog');
$result = mysql_query ($qry) or die();
while($row = mysql_fetch_array($result))
{
echo "<div class = 'wrapper-blog-display'>";
echo "<div class = 'blog-display-title'>". $row['title'] . "</div>" ;
echo "<br>";
echo "<div class = 'blog-display-postedby'>Posted by: <font color=#00CC00>". $row['createdby'] . "</font> " .$row['created']. "</div>" ;
echo "<br>";
echo "<div class = 'blog-display-post'>". $row['content'] . "</div>" ;
echo "<br>";
echo "<div class = 'blog-display-post-readmore'><a href = '". $row['filename'] . "'>Read More</a></div>" ;
echo "<br>";
echo "</div>";
}
?>
When i use the first way the text inside the blog-display-post div tag displays fine and wraps over on to the next line. When i pull thee info from a database, all the text is on one long line instead of naturally wrapping when it hits the end of the div box. WHY?
I would assume it should do the same as the php generated version is exactly the same.
Does anyone know why or how to fix?
thanks in advance.

New Topic/Question
Reply



MultiQuote







|