Home > php教程 > php手册 > php 执行事务的时候pdo出现问题,事务pdo

php 执行事务的时候pdo出现问题,事务pdo

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 09:18:40
Original
901 people have browsed it

php 执行事务的时候pdo出现问题,事务pdo

新版本的pdo会有这个问题: 

General error: 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.' in。。。 

意思是要么使用fetchAll(),要么使用MYSQL_ATTR_USE_BUFFERED_QUERY这个属性,前者不想那样用,因为担心占用内存,后者发现没效果。 

 <span>$this</span>->db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, <span>true</span>);
Copy after login

参考博客:

http://www.flashj.cn/wp/pdo-transaction-err-in-php.html

Related labels:
pdo
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Database pdo connection problem
From 1970-01-01 08:00:00
0
0
0
pdo installation
From 1970-01-01 08:00:00
0
0
0
$pdo->exec($sql);Why does it always return false?
From 1970-01-01 08:00:00
0
0
0
PHP PDO predefined constants
From 1970-01-01 08:00:00
0
0
0
PDO query data error
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template