PHP - Get 3 latest value from DB
How to get 3 latest value from db. my codes to show all value like this :
<?php
$query="select hari from reg";
$hasil=mysql_query($query);
?>
<table style="text-align:center;">
<tr>
<th >Data</th>
</tr>
<?php
if($hasil === FALSE) {
die(mysql_error());
}
while ($data=mysql_fetch_array($hasil)){
echo ("<tr>
<td> $data[hari] </td>
</tr>");}
?></table>
Thanks for the help.
No comments:
Post a Comment