as we go inside a category the link shoul apear on the view page any one help....
i have done this much so far
<?php
include("connectivity.php");
$parentid=$_REQUEST['parentid'];
if(!$parentid)
{
$parentid=0;
}
$a=$_REQUEST['a'];
if(!$a)
{
$a=0;
}
$qry=mysql_query("select * from category where iparentid='$parentid' limit $a,4");
$qrynum=mysql_query("select * from category where iparentid='$parentid'");
$num=mysql_num_rows($qrynum);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>view</title>
</head>
<body>
<h2 align="center">category</h2>
<table align="center" border="3"/>
<tr><td colspan="3" align="right"><a href="add.php?parentid=<?php echo $parentid; ?>">Add</a></td></tr>
<tr><td>sl.no</td><td>category</td><td>description</td></tr>
<?php
//prev code
if($a>0)
{
$a=$a-4;
echo "<a href=\"view.php?a=$a&parentid=$parentid\">prev</a> ";
$a=$a+4;
}
//prev code ends here
//page no
$div=$num/4;
$rem=$num%4;
if($rem>0)
{
$div=$div+1;
}
$b=0;
for($i=1;$i<=$div;$i++)
{
if($a==$b)
{
echo "<a href=\"view.php?a=$b&parentid=$parentid\"><font color='red'>$i</font></a> ";
}
else
{
echo "<a href=\"view.php?a=$b&parentid=$parentid\">$i</a> ";
}
$b=$b+4;
}
//
//next code starts here
$a=$a+5;
if($a<$num)
{
echo "<a href=\"view.php?a=$a&parentid=$parentid\">Next</a> ";
}
$a=$a-5;
//next code ends here
?>
<?php
$sl=1+$a;
while($obj=mysql_fetch_object($qry))
{
echo "<tr>";
echo "<td>$sl</td>";
echo "<td><a href=\"view.php?parentid=$obj->icatid\">$obj->vcategory</a></td>";
echo "<td>$obj->vdescription</td>";
echo "</tr>";
$sl++;
}
?>
</table>
</body>
</html>