i'm new in php coding, and a have a small problem. I wanna make more pages to be posted if there are more than 20 rows in a table. What is the problem exactly?
<?php
$sql = "SELECT COUNT ID FROM out_fact";
$query = mysql_query($sql);
$result = mysql_fetch_row($query);
$total_records = $result[0];
$total_pages = ceil($total_records / 20);
for ($i=1; $i<=$total_pages; $i++) {
echo "<a href='view.php?page=".$i."'>".$i."</a> ";
};
?>
If you need all the code, let me know. Thanks a lot!