I've managed to set up a loop to retrieve results from a table and display them in a list...
But now how can I limit it so that it only displays 10/per page and then it says..
Showing results 1-10 of 100
Page 1/10
..and includes links to page 1,2,3 etc.
An example of the code I've already got...
PHP Code:
$query="SELECT * FROM test2 WHERE name LIKE 'J%'";
$result=mysql_query($query);
$num=mysql_numrows($result);
echo "<table>";
$i=0;
while ($i < $num) {
$first=mysql_result($result,$i,"name");
$last=mysql_result($result,$i,"age");
echo " <tr>
<td width='478'><p>Name: $first</td>
<td width='478'><p>Age: $last</td>
</tr>";
$i++;
}
echo "</table>";
Anyone be able to help?
Thanks
-James 
Last edited by Dark-Skys99 : 07-30-2004 at 08:44 PM.
Reason: Spelling error in title : Getting late :)
|