Question : PHP LOOP FOR BLOG

Hello there, I am trying to develop a blog with my work on. This is to be pulled from the database and displayed. however i have no idea how to loop this to have one item after the other displayed i have a rough idea of how it is done but dont know how to loop it.. any help is greatly appricated..

Many thanks

Mark

So far what ive got is as follows...

loop start

<div class="post">
                        <h1 class="title"><a href="#">$result['headline']</a></h1>
                        <p class="byline"><small>Posted on $result['date'] by <a href="#">Name</a></small></p>
                        <div class="entry">
                              <p>$result['description']</p>
<p class="links"><a href="#" class="more">Read More</a> &nbsp;&nbsp;&nbsp; <a href="#" class="comments">No Comments</a></p>
                        </div>
                  </div>
loop end

Answer : PHP LOOP FOR BLOG

<?php
$query = mysql_query("SELECT .... FROM ... WHERE...");
while ($result = mysql_assoc_array($query)) {
echo '<div class="post">
                        <h1 class="title"><a href="#">'.$result['headline'].'</a></h1>
                        <p class="byline"><small>Posted on '.$result['date'].' by <a href="#">Name</a></small></p>
                        <div class="entry">
                              <p>'.$result['description'].'</p>
<p class="links"><a href="#" class="more">Read More</a> &nbsp;&nbsp;&nbsp; <a href="#" class="comments">No Comments</a></p>
                        </div>
                  </div>
';
}
Random Solutions  
 
programming4us programming4us