hello allzzzzz hope you are fine i need small help please solve it
Error is
Warning: mysql_data_seek() [function.mysql-data-seek]: Offset 12 is invalid for MySQL result index 6 (or the query data is unbuffered) in C:\wamp\www\Classified\admin\addsubcat.php on line 90
and Here is The file Code
<?php
include "connect.php";
session_start();
if(isset( $_SESSION['diradmin']))
{
print "
";
print "
";
include "adminleft.php";
print " | ";
print "";
print "";
print "Add Subcategory | ";
print "";
if(isset($_POST['submit']))
{
if(!isset($_POST['cat']))
{
print "You did not type in a category name.";
}
else
{
$cat=$_POST['cat'];
$checkdup="SELECT * from cl_categories where CatName='$cat'";
$checkdup2=mysql_query($checkdup) or die("Could not check for dups");
$checkdup3= mysql_fetch_array($checkdup2);
if($checkdup3)
{
print "A category of that name already exists";
}
else
{
$catdes=$_POST['catdes'];
$catparent=$_POST['catparent'];
$addcat="INSERT into cl_categories (CatName,Catdescription,CatParent) values('$cat','$catdes','$catparent')";
mysql_query($addcat) or die("Could not update Category");
print "Category Added ";
}
}
}
else
{
print "Type in name of category to add: ";
print "";
print " ";
print "Subcategory of: ";
print "";
$query = "SELECT * FROM cl_categories order by CatName ASC";
$sql = mysql_query($query) or handledberror(7,mysql_error());
traverse(0,0,$sql);
print "";
print "Category Description: ";
print " ";
print "";
}
print " |
";
print " |
";
}
else
{
print "Not logged in";
}
?>
<?php
function traverse($root, $depth, $sql)
{
$row=0;
while ($acat = mysql_fetch_array($sql))
{
if ($acat['CatParent'] == $root)
{
print "";
$j=0;
while ($j<$depth)
{
print " ";
$j++;
}
if($depth>0)
{
print "-";
}
print $acat['CatName'] . "";
mysql_data_seek($sql,0);
traverse($acat['CatID'], $depth+1,$sql);
}
$row++;
mysql_data_seek($sql,$row);
}
}
?>