我怎么能回应最后的记录php mysql [重复]

This question already has an answer here:

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!

</div>

try this query... SELECT * FROM your_dataBase ORDER BY id DESC LIMIT 4