Codeigniter-如何运行多个/批处理查询? [英] Codeigniter - how to run multiple/batch queries?

查看:61
本文介绍了Codeigniter-如何运行多个/批处理查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一堆查询,这些查询是由一台服务器上的Shell脚本生成的,并由另一台服务器上的CI应用程序使用.分别运行时,查询运行良好,但批量运行时,查询失败.有没有出路?请注意,这些不是多个插入或更新,并且查询可能跨越多行

I have a bunch of queries that are generated by a shell script on one server and are to be consumed by a CI app on another server. The queries run fine when run individually but fail when run as a batch. Is there any way out? Please note that these are not multiple inserts or updates and queries may span more than one line

推荐答案

这不是CodeIgniter的限制,而是数据库客户端库的限制.

This is not a limitation of CodeIgniter but rather of the database client libraries.

mysql_query()一次只能执行一个查询.

I.e., mysql_query() can only execute a single query at a time.

根据客户的不同,还有其他选择

Depending on the client, there are alternatives,

mysqli_multi_query()

这篇关于Codeigniter-如何运行多个/批处理查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆