Hello ladies and gents, i hope you are all well! Just recently joined this site looks great and easy to use.
I am just getting into php and msql i have managed to create a table that spits out the data but i am looking for a really simple way to paginate this while loop so it only shows a certain number of rows, then some buttons to load the next page.
Could any please point me in the right direction here? i have came acros some crazy examples.. Just looking for a clean simple way.
Many thanks.
<h2 align="center">List of Companies</h2> <table id="ver-minimalist" align="center" border="0" cellspacing="0" cellpadding="5" width="100%"> <thead> <th>No</th> <th>Name</th> <th>Company</th> <th>Revenue</th> <th>Location</th> <th>Action</th> </thead> <?php
$i=1;
while ($row=mysql_fetch_assoc($query)) {
echo "<tr> <td>".$i."</td> <td>".$row['name']."</td> <td>".$row['company']."</td> <td>".$row['revenue']."</td> <td>".$row['location']."</td> <td align='center'> <a href='index.php?epr=delete&id=".$row['id']."'>DELETE</a> |
<a href='index.php?epr=update&id=".$row['id']."'>UPDATE</a> |
</td> </tr>";
$i++;
}
?> </table> </table>