我使用此查询得到如下所示的数组:
SELECT id, person_id, description, path FROM comment WHERE path <@ '0001' ORDER by path
我的问题是我如何使用将输出显示为线程?我是否检查前四个数字并增加以查看它们是否处于同一水平或是否存在我无法理解的内容?
[0] => Array
(
[id] => 1
[person_id] => 1
[description] => a75e62536ca2687ae5817acb739e61f3
[path] => 0001
)
[1] => Array
(
[id] => 2
[person_id] => 2
[description] => 010242f78cd5d41abb16a8ba488957a1
[path] => 0001.0001.0001
)
[2] => Array
(
[id] => 3
[person_id] => 2
[description] => cdde38b2b13ee808ce5423cdf8d14bab
[path] => 0001.0001.0001.0001
)
[3] => Array
(
[id] => 4
[person_id] => 1
[description] => 6b837ce73896fbd080bd0b93837ad537
[path] => 0001.0001.0001.0002
)
[4] => Array
(
[id] => 5
[person_id] => 5
[description] => e5694a273ed95d36934cff48cd8fb12a
[path] => 0001.0001.0001.0003
)
[5] => Array
(
[id] => 6
[person_id] => 6
[description] => 15b2ad371934352c0b16c5c1585f3d7d
[path] => 0001.0002
)
[6] => Array
(
[id] => 7
[person_id] => 6
[description] => 2d1595f0c4ec527c601f404c7a272407
[path] => 0001.0002.0001
)
[7] => Array
(
[id] => 8
[person_id] => 6
[description] => 8286c3bbe511d866e4e2ef4321a429d7
[path] => 0001.0003
)
[8] => Array
(
[id] => 9
[person_id] => 8
[description] => dc455dd484220176d1d2198f84bdbc90
[path] => 0001.0003.0001
)
[9] => Array
(
[id] => 10
[person_id] => 9
[description] => b8a8f41b224f900f6f5de0e591ba13b8
[path] => 0001.0003.0002
)
[10] => Array
(
[id] => 11
[person_id] => 11
[description] => ef132c4663961ff09ca61f40eec72697
[path] => 0001.0003.0002.0001
)