如何使用PHP检索表的类别和子类别(无限级别) [英] How to retrieve categories and child categories (unlimited level) to table with PHP

查看:71
本文介绍了如何使用PHP检索表的类别和子类别(无限级别)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有类别表...(ID,ParentID,标题,订购)



cat1

--cat1.1

--cat1.2

--- cat1.2.2

--- cat1.2.3

--- cat1.2.4

----无限级别

--cat1.3

cat2

cat3



i跟着这个美妙的 教程



使用PHP和MySQL的无限动态多级嵌套类 - Roy教程





一切都很好但是,

1-我需要把结果放在表格中。像这样的 [ image ]

2-我需要将结果放在选择框中。像这样的 [图片]



谢谢



我的尝试:



i跟着这个精彩的 教程

i have categories table .. (ID,ParentID,Title,Ordering)

cat1
--cat1.1
--cat1.2
---cat1.2.2
---cat1.2.3
---cat1.2.4
----Unlimited level
--cat1.3
cat2
cat3

i followed this wonderful tutorials

Infinite dynamic Multi-level nested category with PHP and MySQL – Roy Tutorials


all thing is good but,
1- i need to put the result in table . like this [image]
2- i need to put the result in select box.like this [image]

thank you

What I have tried:

i followed this wonderful tutorials

推荐答案

<?php

//fetc.php
<?php
//fetc.php


connect = mysqli_connect(localhost,root,,shopp);
connect = mysqli_connect("localhost", "root", "", "shopp");


query =SELECT * FROM maincategory;
query = " SELECT * FROM maincategory ";


这篇关于如何使用PHP检索表的类别和子类别(无限级别)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆