Simple infinite classification ideas

xiaoxiao2021-03-06  37

* / mysql_connect ("localhost", 'root', ''); mysql_select_db ("test"); $ cate_table = "category"; function _getcategory ($ category_id = 0, $ depth = 1) {Global $ cate_table; $ sql = "SELECT * FROM $ cate_table ORDER BY categoryID DESC"; $ result = mysql_query ($ sql); while ($ row = mysql_fetch_array ($ result)) {$ array [$ row [categoryParentID]] [$ row [categoryID]] = array ('id' => $ row [categoryid], 'parent' => $ row [categoryParentID], 'name' => $ row [categoryName]);} f (! isset ($ array [$ category_id]) "{Return" ";} foreach ($ array [$ category_id] AS $ key => $ category) {echo"

CopyRight © 2020 All Rights Reserved
Processed: 0.040, SQL: 9