-
無線分類原理查看全部
-
數(shù)據(jù)表設(shè)計查看全部
-
CREATE TABLE IF NOT EXISTS `deepcate` ( `id` int(4) NOT NULL, `pid` int(11) NOT NULL, `catename` varchar(30) NOT NULL, `cateorder` int(11) unsigned NOT NULL DEFAULT '0', `createtime` int(10) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='cms類型表'; -- -- 轉(zhuǎn)存表中的數(shù)據(jù) `deepcate` -- INSERT INTO `deepcate` (`id`, `pid`, `catename`, `cateorder`, `createtime`) VALUES (1, 0, '新聞', 0, 0), (2, 0, '圖片', 0, 0), (3, 1, '國內(nèi)新聞', 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), (10, 9, '日本AV', 0, 0);查看全部
-
無限級分類 1、已父ID實現(xiàn)的無限分類 2、以全路徑實現(xiàn)的無限分類(用一個字段記錄所有子分類id)查看全部
-
全路徑無限分類的優(yōu)點在于 不需要遞歸 關(guān)鍵SQL語句是: $sql = 'select id,name,path,concat(path,"-",id) as fulpath from goods order by fulpath asc';查看全部
-
常見的集中查看全部
-
//由于mysql 7.0廢棄,補充一下mysqli的寫法 ---1---- <?php $db_host = '127.0.0.1'; $db_user = 'root'; $db_password = '123456'; $db_name = 'imooc'; $link = mysqli_connect($db_host,$db_user,$db_password) or die(mysqli_error()); mysqli_select_db($link,$db_name) or die(mysqli_error()); mysqli_query($link,"set names utf8"); //---2--- <?php header("content-type:textml;charset=utf8"); include("db.inc.php"); function getList($link=null,$pid=0,&$result=array(),$spac=0){ $sql = "select * from `deepcate` where `pid` = $pid"; $res = mysqli_query($link,$sql); while($row = mysqli_fetch_assoc($res)){ $row['catename']=str_repeat(' ',$spac).'|--'.$row['catename']; $result[] = $row; getList($link,$row['id'],$result,$spac); } return $result; } $rs = getList($link); print_r($rs);查看全部
-
無限級分類查看全部
-
無限極分類實現(xiàn)方法查看全部
-
mysql_fetch_array , assoc , row 的區(qū)別了。分別為索引數(shù)組和關(guān)聯(lián)數(shù)組,關(guān)聯(lián)數(shù)組,索引數(shù)組。查看全部
-
Infinite classification查看全部
-
無限分類一般用在增刪改(后臺操作)分類上,全路徑無限分類用在查詢語(前臺展示)。二者的本質(zhì)是一樣都要遞歸,只不過所獲取結(jié)果不一樣。查看全部
-
終于搞明白mysql_fetch_array , assoc , row 的區(qū)別了。分別為索引數(shù)組和關(guān)聯(lián)數(shù)組,關(guān)聯(lián)數(shù)組,索引數(shù)組。查看全部
-
全路徑分類導航查看全部
-
全路徑無限分類查看全部
舉報
0/150
提交
取消