代码无法插入???
INSERT INTO 'deepcate'(`id`, `pid`, `catename`, `cateorder`, `createtime`)VALUES
(1,0,"新闻",0,0),
(1,0,'新闻',0,0),
(2,0,'图片',0,0),
(3,1,'国内新闻',0,0),
(4,1,'国际新闻',0,0),
(5,3,'北京新闻',0,0),
(6,4,'美国新闻',0,0),
(7,2,'美女图片',0,0),
(8,2,'风景图片',0,0),
(9,7,'日韩明星',0,0),
(9,9,'日本AV',0,0);
INSERT INTO 'deepcate'(`id`, `pid`, `catename`, `cateorder`, `createtime`)VALUES
(1,0,"新闻",0,0),
(1,0,'新闻',0,0),
(2,0,'图片',0,0),
(3,1,'国内新闻',0,0),
(4,1,'国际新闻',0,0),
(5,3,'北京新闻',0,0),
(6,4,'美国新闻',0,0),
(7,2,'美女图片',0,0),
(8,2,'风景图片',0,0),
(9,7,'日韩明星',0,0),
(9,9,'日本AV',0,0);
2016-02-11
while($row=mysql_fetch_assoc($res))
{$row['catename'] = str_repeat(' ',$spac) . '|--' . $row['catename'];
$result[] = $row;
getList($row['id'],$result,$spac);
}
return $result;
}
$rs = getList();
print_r($rs);
?>
{$row['catename'] = str_repeat(' ',$spac) . '|--' . $row['catename'];
$result[] = $row;
getList($row['id'],$result,$spac);
}
return $result;
}
$rs = getList();
print_r($rs);
?>
2015-12-08
<?php
funtion getList($pid=0,&$result=array(),$spac=0){
$spac = $spac + 2;
$sql="SELECT * FROM deepcate WHERE pid = $pid";
$res= mysql_query($sql);
funtion getList($pid=0,&$result=array(),$spac=0){
$spac = $spac + 2;
$sql="SELECT * FROM deepcate WHERE pid = $pid";
$res= mysql_query($sql);
2015-12-08