The idea of implementing Infinitus column classification: Get the self-increasing ID (that is, the parent ID) and then get the child ID (that is, the uid child ID) from the database. The data is as follows
id:1 uid:0 I am column 1
id:2 uid:1 I am column 2
id:3 uid:1 I am a subcategory of column 1
Display results: Is a subcategory of Column 1
I am Column 2
The following is the Php code
Copy code
The code is as follows: $query = $this->db-> ;query("SELECT * FROM category");
$list = $query->result();
foreach($list as $v){
if($v->category_id = = 0){//Get the parent column (anything equal to 0 is the parent column)
$categoryul = anchor("home/content/".$v->id,$v->category_name);
echo "
";
$listx = $this->Listx->list_id($v->id);//According to the parent id displays the specified sub-column
foreach($listx as $vid){
$category = anchor("home/content/".$vid->id,$vid ->category_name );
echo "
".$category."";
}
}
}
?>
http://www.bkjia.com/PHPjc/825289.html
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/825289.htmlTechArticle Ideas for implementing Infinitus column classification: Get the self-increasing ID (that is, the parent ID) and then get the child ID from the database (That is, uid sub-id) The data is as follows id:1 uid:0 I am column 1 id:2 uid:1 I am column...