displaying all rows from db
Posted: Mon Jan 23, 2006 5:54 pm
I've used code like this quite a few times with no problem.
I'm trying to display all the rows in a table called news.
I know there is data in there as well.
When I test it only shows the most recent entry.
Am I missing something?
I'm trying to display all the rows in a table called news.
I know there is data in there as well.
When I test it only shows the most recent entry.
Am I missing something?
Code: Select all
$sql = "SELECT * FROM news";
$result = mysql_query($sql, $conn) or die(mysql_error());
while ($newArray = mysql_fetch_array($result)){
$headline = $newArray ['headline'];
$content = $newArray ['content'];
$time = $newArray ['date_added'];
}
echo "$headline,$content,$time <br \>";