PHP n00b questions - while loop

Hi all,

Trying to get my head round displaying database entries, I have created the following code

$result = mysql_query("SELECT * FROM wp_posts");

$row = mysql_fetch_array($result);

while(){
    echo $row['post_title'] . '<br />';
    echo $row['post_modified'];
}

I want to display each post_title and post_modified using a while loop but not sure what I need to add to the while loop to perform this task?

CAn anyone shed some light on what I have to do?

Many thanks

Kyle

Hi ditch!

Thanks for the reply, I tried the top example and this only 1 entry but multiple multiple times?

Kyle

$row = mysql_fetch_array($result); 

while($row){ 
    echo $row['post_title'] . '<br />'; 
    echo $row['post_modified']; 
}

Or, more concise:

while($row = mysql_fetch_array($result) ){ 
    echo $row['post_title'] . '<br />'; 
    echo $row['post_modified']; 
}

The top example is slightly wrong, the second one is much better.