here's my code
<html>
<body>
<?
//connect to database
@ $db=mysql_pconnect("localhost","news","protox");
if (!$db)
{
echo("couldn't connect");
exit;
}
mysql_select_db("news");
$query="select * from articles";
$result=mysql_query($query);
if (!$result)
{
echo("couldn't query");
exit;
}
$num=mysql_num_rows($result);
for ($i=0; $i<5; $i++)
{
$row=mysql_fetch_array($result);
echo($row["title"]);
echo("<br><br>");
echo($row["author"]);
echo(" ");
echo($row["date"]);
echo("<p>");
echo($row["articles"]);
echo("<p>");
}
?>
</body>
</html>
this is a test version so I haven't paid much attention to text formatting. anyway, how do I make it so I only display the most recent news articles in my db? thanks in advance.