|
本帖最后由 tangyanglai 于 2015-12-27 16:10 编辑
数据库中数据是
ColumnNo是主键
SuperNo是父亲的ColumnNo
Levels是层级号。
我比较笨的办法,
先数据库查询第一级导航的数据
Select * From Web_Column where length(levels)=3 result_1
在查出第二级导航的数据
Select * From Web_Column where length(levels)=6 result_2
然后我前台页面进行循环 foreach(result_1 as row)
现在我要查询result_2中ColumnNo=row->ColumnNo的数据,请问怎么查询。
我的生成方法比较笨,有什么好的方法吗?
|
|