本文实例讲述了php执行多个存储过程的方法。分享给大家供大家参考,具体如下:
从以前的使用原生代码来看,只需要将结果集关闭即可,即
$this -> queryID -> close();
使用mysqli方式,修改DbMysqli.class.php,将query函数改为:
public function query($str) {
$this -> initConnect(false);
if (!$this -> _linkID) {
return false;
}
$this -> queryStr = $str;
//释放前次的查询结果
if ($this -> queryID)
$this -> free();
N('db_query', 1);
// 记录开始执行时间
G('queryStartTime');
$this -> queryID = $this -> _linkID -> query($str);
// 对存储过程改进
$ret = array();
$this -> debug();
if (false === $this -> queryID) {
$this -> error();
return false;
} else {
$this -> numRows = $this -> queryID ->