douguanyan9928 2014-03-21 02:54
浏览 196
已采纳

使用PHP中的一个mysqli_query调用更新多个MySQL记录

I have to update hundreds of records at once and I'm wondering if it's possible to use one mysqli_query call to update all of them. I know it isn't possible to use something like:

UPDATE table SET col=value1,col=value2,col=value3 WHERE id IN (1,2,3)

Is it possible to somehow use custom functions or another method to update multiple records at once?

  • 写回答

3条回答 默认 最新

  • dongxidui1227 2014-03-21 05:21
    关注

    use mysqli_multi_query() function, by which you can concat all the queries and pass it the mysqli_multi_query function

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突