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条)

报告相同问题?