Navigation Help
am 04.06.2008 17:23:39 von Nasreen Laghari--0-141590419-1212593019=:87821
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,=0ACould any one please help me with Page Navigation. I have done Next a=
nd Previous page Navigation but confused on printing page numbers (1,2,3,4)=
and hyperlink them. Below is the code which i'm halfway on but it only pri=
nts "1" with no hyperlink where as I have 11 pages, if i print $noPages.=0A=
Could you please correct where i'm mistaking.
$result =3D safe_query("=
select count(*) FROM gig g, venue v WHERE g.gigName LIKE '%".$gig_name."%' =
");
$noEntries =3D mysql_num_rows($result);
$noPages =3D ceil($no=
Entries / $limit);
=A0$currentPage =3D 0;
if(isset($_GET['pag']) =
&&
is_numeric($_GET['pag']) &&
$_GET['pag'] > 0 &=
&
$_GET['pag'] < $noPages){
=A0=
$currentPage =3D $_GET['pag'];
}
$start =3D $currentPage *=
$pageLimit;
=A0$sqlTotal =3D "select * FROM gig g, venue v WHERE g.gi=
gName LIKE '%".$gig_name."%' ".$start.",".$limit;
for($a =3D 0; $a < $=
noPages; $a++){
if($currentPage == $a){
=
echo($a+1);
}else{
echo '
=3D"'.$_SERVER['PHP_SELF'].'?spag=3D'.$a.'">'.($a+1).'';
}=
if($a < $noPages - 1){
echo '-';
=
}=0A}
=0A
--0-141590419-1212593019=:87821--