php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56305 General error: 2014 Commands out of sync; you can't run this command now
Submitted: 2005-02-17 08:17 UTC Modified: 2005-06-10 02:23 UTC
Votes:7
Avg. Score:4.3 ± 0.9
Reproduced:7 of 7 (100.0%)
Same Version:3 (42.9%)
Same OS:1 (14.3%)
From: lphuberdeau at phpquebec dot org Assigned: wez (profile)
Status: Wont fix Package: PDO_MYSQL (PECL)
PHP Version: 5.0.3 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lphuberdeau at phpquebec dot org
New email:
PHP Version: OS:

 

 [2005-02-17 08:17 UTC] lphuberdeau at phpquebec dot org
Description:
------------
The problem mostly occur when multiple queries are made at once (loops made afterwards). 

Exception is thrown:
General error: 2014 Commands out of sync; you can't run this command now


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-17 08:36 UTC] lphuberdeau at phpquebec dot org
I found a similar bug related to the MySQL library.
http://bugs.php.net/bug.php?id=19529

I made a rollback on the code to the old mysql_ functions and it all works fine. The bug report refers to mysql_db_query() as the function causing problems. All the code currently has mysql_query() calls.
 [2005-02-18 11:03 UTC] wez@php.net
This is expected behaviour; PDO opens forward-only rowsets that fetch on demand by default.  (equivalent to http://www.php.net/mysql_unbuffered_query).

This is by design, and encourages you to write more efficient scripts.
I will look into something more convenient, however.
 [2005-04-03 09:17 UTC] Jared dot Williams1 at ntlworld dot com
[quote]I will look into something more convenient, however.[/quote]

Excellent. Does seem a pain, when sqlite & pgsql can have multiple unbuffered queries.
 [2005-06-10 02:23 UTC] wez@php.net
Use PDOStatement::fetchAll()
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 16 12:03:34 2021 UTC