Hi all,
The following code should select all data, grab the highest value row (i.e. the newest), and display that exact rows number, contained text and time/date of creation.
It is correctly grabbing the row number, but still only grabbing the contents of the first row.
I am not getting any errors at all, just the displayed data is incorrect
<?php
$dbh=mysql_connect ("-", "-", "-") or die
('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("silverlink");
$rs = mysql_query("SELECT max(post_id), post_text, post_create_time FROM forum_posts ") or die
(mysql_error());
while ( $rows = mysql_fetch_array( $rs) )
{
echo "<p>";
echo $rows['post_text'];
echo "</p>";
echo "<p>";
echo $rows['post_create_time'];
echo "</p>";
echo $rows[0];
}
?>