Display only latest three results from PHP and MySQL
- by nogggin1
<?php
$result = @mysql_query('SELECT Article
FROM news
WHERE ID = (SELECT MAX(ID) FROM News)');
if (!$result) {
die('<p>Error performing query: ' . mysql_error() .
'</p>');
}
while ( $row = mysql_fetch_array($result) ) {
echo('<p>' . $row['Article'] . '</p>');
}
?>
basically i need to tweak this so that it shows the latest 3 results instead of just the latest one, also i need the order to be:
newest
2nd newest
3rd newest
any help would be greatly appreciated!