1

我正在使用具有 jquery 嵌套可排序列表的简单脚本

我用这个插件来管理这个嵌套列表

它工作得很好,但是我需要编写用于更新 mysql 表的后端 PHP 代码的问题我真的很困惑这是我在更新嵌套列表时从 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

但我不知道如何将它们更新到数据库中,以便以正确的方式对它们进行排序?

4

0 回答 0