donkey111111 2019-03-23 19:32
浏览 73

在父子结构中获取“最后一个列表”(MYSQL / PHP)

Good Hello,

I have created a simple tree structure.

This is the table structure


ID is_parent_id

category_name

if is_parent_id=0 , then those are the top level parents .

to get sub-categories (children) of any category (ie: ID=5) you just : SELECT * FROM categories WHERE is_parent_id=5

simply enough right?

now the problem I have is that if I want to go BACK . and get the last viewed list.

remember that the tree is generated dynamically, and the user can theoretically be Hundred levels down.

is there any way I can have a dynamic "back" button that allows the user to back as far as he wants?


I'm trying to maybe pass the current clicked paren_ID into a tag clicked_id_1="X".., So I can use down the next level if the user clicks the back button, but I can't keep storing ALL THE CLICKED_IDS in all the levels, can I?

I'm really stuck and need someone that will look at this matter from outside the box.

I need the "back" button to work dynamically and practically. without the "number of levels," the user has gone through be a factor to its efficiency

Thank you

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100