I converted everythihng to support odbc instead of mysql. this what it looks like.
could you comment you code..? you created a really simple, very logical script.
<?
//#####################
// Paging ODBC
//####################
$dblink = odbc_connect("blast_intranet", "blast_intranet", "blast_intranet");
//mysql_select_db("approvedwebhosts",$dblink);
$query = "SELECT b_pay_plans.* FROM b_pay_plans";
$result = odbc_do($dblink, $query);
$numrow = odbc_num_rows($result);
$num=0;
//isset checks to see of pgno has been checked or not
if(!isset($pgno))
{
$pgno=1;
}
$currentpage = $pgno;
$pagesize = 10;
$limit = 10;
$pg = $numrow / $pagesize;
for($a = 0; $a < $pg ; $a++)
{
if($a == $pgno - 1)
{
$num = $a $pagesize;
}
}
$dblink = odbc_connect("blast_intranet", "blast_intranet", "blast_intranet");
//mysql_select_db("approvedwebhosts",$dblink);
$query = "SELECT b_pay_plans. FROM b_pay_plans";
$result = odbc_do($dblink, $query);
$numrow = odbc_num_rows($result);
for($k = 0; $k < $pagesize; $k++)
{
if($k > $numrow - 1)
break;
print(odbc_result($result, $k, "plan_code")."<br>\n");
}
if($pgno > 1 )
{
print("<br><a href=paging.php?pgno=" . $pgno = $pgno - 1 . ">[<< Previous]</a> ");
}
for($i = 1; $i <= 20; $i++)
{
if($i == $currentpage)
{
print(" ". $i . " ");
}
else
{
print("<a href=paging.php?pgno=" . $i . ">". $i . "</a>\n");
}
}
if($currentpage < $pg)
{
print("<a href=paging.php?pgno=" . $currentpage = $currentpage + 1 . ">[Next >>]</a>");
}
?>