Salve, ho un problema con mysql_data_seek in un esempio che ho trovato su internet,

mi dite come posso risolvere questo Warning?

Warning: mysql_data_seek() [function.mysql-data-seek]: Offset 3 is invalid for MySQL result index 5 (or the query data is unbuffered) in D:\xampp\htdocs\directory\submitlink.php on line 121


e il suo codice che viene richiamato e cosi:
traverse(0,0,$selcat2);

codice:
Codice PHP:
<?php
function traverse($root$depth$sql

     
$row=0
     while (
$acat mysql_fetch_array($sql)) 
     { 
          if (
$acat['CatParent'] == $root
          { 
               print 
"<option value='" $acat['CatID'] . "'>"
               
$j=0
               while (
$j<$depth
               {     
                     print 
"";
                    
$j++; 
               } 
               if(
$depth>0)
               {
                 print 
"-";
               }
               print 
$acat['CatName'] . "</option>"
               
mysql_data_seek($sql); 
               
traverse($acat['CatID'], $depth+1,$sql); 
                
          } 
          
$row++; 
          
mysql_data_seek($sql,$row); 
           
     } 
}
da errore qui : mysql_data_seek($sql,$row);
e qui:
mysql_data_seek($sql);
grazie mille.