pagination
Posted: Thu Oct 20, 2011 10:14 pm
Code: Select all
<?php
include 'conn.php';
$query = "SELECT * FROM `r_user` ORDER BY `id` DESC LIMIT 0, 5";
$result = mysql_query($query);
?>
<html>
<head><title> PHP </title></head>
<body>
<h3> Database </h3><br>
<table border="1" align="center" width="600">
<tr>
<td align="center"><font size="2"><strong> ID </font></strong>
<td align="center"><font size="2"><strong> First Name </font></strong>
<td align="center"><font size="2"><strong> Last Name </font></strong>
<td align="center"><font size="2"><strong> Priveledges </font></strong>
<td align="center"><font size="2"><strong> Username </font></strong>
</tr>
<?php while($rows = mysql_fetch_assoc($result)) { ?>
<tr>
<tr>
<td> <? echo $rows ['id']; ?> </td>
<td> <? echo $rows ['firstname']; ?> </td>
<td> <? echo $rows ['lastname']; ?> </td>
<td> <? echo $rows ['priveledges']; ?> </td>
<td> <? echo $rows ['username']; ?> </td>
</tr>
<? }
mysql_close();
?>
</table>
</html>