can some kind person help me figure out why this bit of code is not working please?
<?
include("../../includes/XXX.php");
if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; };
$start_from = ($page-1) * 20;
$sql = "SELECT * FROM table_name ORDER BY sid ASC LIMIT $start_from, 20";
$sql = "SELECT COUNT(sid) FROM table_name";
$rs_result = mysql_query($sql,$dbr);
$row = mysql_fetch_row($rs_result);
$total_records = $row[0];
$total_pages = ceil($total_records / 10);
?>
<table>
<tr><td>sid</td><td>Name</td></tr>
<?
while ($row = mysql_fetch_assoc($rs_result)) {
?>
<tr>
<td><? echo $row["sid"]; ?></td>
<td><? echo $row["name"]; ?></td>
</tr>
<?
};
?>
</table>
<?php
for ($i=1; $i<=$total_pages; $i++) {
echo "<a href='pagination.php?page=".$i."'>".$i."</a> ";
};
?>
The script is suppose to place a row of page links at the foot of a table. I get the row of links (1,2,3,4..) but no actual echoed table!
I think the problem is something to do with the TWO SELECT calls but I'm a very new beginner and thus I can't figure.
thanks 🙂