时间:2021-07-01 10:21:17 帮助过:24人阅读
include_once("../conn.php");
function SontoFather($i)
{
$sql = "SELECT `parent_id`,`cate_name` FROM `dlbz_gcategory` WHERE `cate_id`=".$i;
echo $sql;
echo '
';
$result = mysql_query($sql);
$row=mysql_fetch_row($result);
//echo $row[1];
if($row[0]!=0)
{
$i = $row[0];
//echo $i;
//echo $row[1];
SontoFather($i);
}
else
{
echo $row[1];
//$j=$row[1];
return $row[1];
}
}
echo SontoFather(3);
echo SontoFather(450);
?>