-
[PHP]Pages
So I have a script that gets services that people did. And I realized that the mysql got too long for my template. So the only smart thing that must be done was to make pages. However, I am like clueless on the concept of pages. I understand that they are $_GET links and they change the limit query. But, how can I make it show the number of pages needed to show all of the logs?
here is a portion:
PHP Code:
//Log Script
$query = mysql_query("SELECT community.id, service.action, service.hours, community.name FROM service, community WHERE service.approved = '1' AND community.id = service.keyid ORDER BY 'community.name' LIMIT 0,10") or die(mysql_error());
echo "<table border='1'>";
echo "<tr> <th>Name</th> <th>Action</th> <th>Hours</th> </tr>";
while($row = mysql_fetch_array( $query )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['name'];
echo "</td><td>";
echo $row['action'];
echo "</td>";
echo "<td>";
echo $row['hours'];
echo "</td></tr>";
}
-
Re: [PHP]Pages