For a project a need the echo the last 4 database records. I have a script that show all the records but I need only the last 4. Can someone help me?
<?php
$con = mysql_connect("localhost","test","test");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$result = mysql_query("SELECT * FROM formulier");
echo "<table border='1'>
<tr>
<th>tafel</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['tafel'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
Thanks!