method of classify one
复制代码 代码如下:
0){
echo ;
}else{
echo ;
}
}//如果不等于0
else{
//根据typeid 找到 该id下的type_p_id
$sql = select type_p_id from `types` where type_id = $type_id;
$res = mysql_query($sql);
$res = mysql_fetch_assoc($res);
$type_id = $res['type_p_id'];
//先将名称插入进去
$sql = insert into types set type_name = '{$type_name}';
$res = mysql_query($sql);
//获取最后执行的id 然后进行数据更新 主要更新 type_p_id
$id = mysql_insert_id();
$sql = update types set type_p_id = '$type_id$id,' where type_id=$id;
$res = mysql_query($sql);
if($res){
echo ;
}else{
echo ;
}
}
}elseif($act==add){
?>
新分类名称:
当前分类:
顶级分类
id 分类名 path路径 操作
编辑 |
删除
types表:
下面是效果图:
method of classify two
复制代码 代码如下:
新分类名称:
当前分类:
顶级分类
0){
echo ;
}else{
echo ;
}
}elseif($act == list){
//获取列表根据 分类层进行排序
$sql = select * from type order by concat(type_id,type_p_id);
$res = mysql_query($sql);
?>
id 分类名 path路径 操作
编辑 |
删除
type表:
下面是效果图
写的确实不怎么样啊 还望大家见谅。
http://www.bkjia.com/phpjc/326919.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/326919.htmltecharticle今天写了下无限极分类 下面就把代码贴上来了 写的不怎么样。 method of classifyone 复制代码 代码如下: ?php /* reader: 这是自己写的无限极分类...
