【问题标题】:How to create a Php multi insertion? [closed]如何创建一个 PHP 多插入? [关闭]
【发布时间】:2019-11-19 17:40:27
【问题描述】:

我正在尝试使用 php 准备在数据库中插入,但我找不到有关如何使用语法的任何建议,这是我到目前为止所得到的,有人可以帮我吗?

   $last_id = mysqli_insert_id($conn);

   $query = $conn->prepare("INSERT INTO `table`(name, surname) VALUES (?,?) , (?,?)");

   $query->bind_param("ss", ($nameOne, $last_id), ($nametWO, $last_id));

【问题讨论】:

    标签: php mysqli prepared-statement bindparam


    【解决方案1】:

    绑定应该是

    $query->bind_param("ssss", $nameOne, $last_id, $nametWO, $last_id);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-05
      • 2013-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多