Maybe you can show me? Below I pasted the code I am using, now this code allows me to call an id via ?id=id number). And this does work, it will grab an article and the corresponding comments. Now i want to call the "latest" article and corresponding comments. (note: that article and comments are on the same page) Thanks for your guys help once again.
<?
$db = mysql_connect ('localhost','user,'pass');
mysql_select_db ('databaselearndb',$db);
$query = "SELECT id,title,newstext," .
"DATE_FORMAT(postdate, '%Y-%m-%d') as date " .
"FROM news WHERE id='$id'";
$result = mysql_query ($query);
while($myrow = mysql_fetch_array($result))
{
echo "<TABLE border=\"1\" width=\"300\">\n";
/* place table row data in
* easier to use variables.
* Here we also make sure no
* HTML tags, other than the
* ones we want are displayed */
$date = $myrow['date'];
$title = htmlentities ($myrow['title']);
$news = nl2br (strip_tags ($myrow['newstext'], '<a><b><i><u>'));
echo "<TR><TD><b>$title</b> posted on $date</TD></TR>\n";
echo "<TR><TD>$news</TD></TR>\n";
}
$comment_query = "SELECT * FROM news_comments WHERE news_id='$id'";
$comment_result = mysql_query ($comment_query);
while($myrow = mysql_fetch_array($comment_result))
{
echo $myrow['COMMENT'];
echo "<br><br>";
}
?>
Can you edit (help me out) this? Thanks guys.