我在简单的脚本中工作,它有jquery嵌套的可排序列表
我使用此插件来管理嵌套列表this one
它只是工作得很好,但我的后端PHP代码的问题,我需要写更新mysql表我真的很困惑这么多关于它 这是我在更新嵌套列表时从ajax请求获得的最终数组
Array
(
[0] => Array
(
[id] => 3
[children] => Array
(
[0] => Array
(
[id] => 8
)
[1] => Array
(
[id] => 11
)
[2] => Array
(
[id] => 12
)
[3] => Array
(
[id] => 19
)
[4] => Array
(
[id] => 29
)
)
)
[1] => Array
(
[id] => 2
[children] => Array
(
[0] => Array
(
[id] => 4
)
[1] => Array
(
[id] => 9
)
)
)
[2] => Array
(
[id] => 5
[children] => Array
(
[0] => Array
(
[id] => 28
)
)
)
[3] => Array
(
[id] => 1
[children] => Array
(
[0] => Array
(
[id] => 10
)
[1] => Array
(
[id] => 33
)
)
)
[4] => Array
(
[id] => 6
[children] => Array
(
[0] => Array
(
[id] => 32
)
)
)
[5] => Array
(
[id] => 7
)
[6] => Array
(
[id] => 13
)
[7] => Array
(
[id] => 14
)
[8] => Array
(
[id] => 16
)
[9] => Array
(
[id] => 17
)
[10] => Array
(
[id] => 18
)
[11] => Array
(
[id] => 20
)
[12] => Array
(
[id] => 22
)
[13] => Array
(
[id] => 23
)
[14] => Array
(
[id] => 24
)
[15] => Array
(
[id] => 25
)
[16] => Array
(
[id] => 26
)
[17] => Array
(
[id] => 27
)
[18] => Array
(
[id] => 31
)
)
这些都是从数据库推送的ID
但我不知道如何将它们更新到数据库中,以便它们以正确的方式排序?