$fields = $values ​​= [];This code cannot be defined and keeps reporting errors. The teacher's source code also reports errors and cannot be executed. How can I solve this problem?
手机用户1599665486
手机用户1599665486 2020-10-06 20:08:57
0
3
1097

老师代码截图.PNG实践结果.PNG我的代码截图.PNG

手机用户1599665486
手机用户1599665486

reply all(2)
执笔画卿颜 丶
if ($type == 'insert') {
    $fields = $values = [];
    foreach ($data as $key => $value) {
        // 键值存入$fields
        $fields[] = $key;
        // 值存入$values;
        $values[] = $value;
    }
}

二娃你先上

The foreach you wrote is $key=>$value, and $val is used for assignment below. This is definitely wrong.

  • reply Uh uh uh
    零时差 author 2020-10-12 16:32:53
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template