Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:

Go Back   Caucho Forums > Quercus

Thread Tools Display Modes
Old 12-27-2013, 09:14 PM
remaus remaus is offline
Junior Member
Join Date: Dec 2013
Posts: 1
Default multiple prepared statements using PDO in php

I have a lot of php code that runs against a MySQL MyISAM database using the old (deprecated) mysql driver. I am trying to get the applications to run under Resin/quercus (4.0.37) with the desire to use multiple prepared statements against a single database connection. However, we keep running into the following error.

C:\resin-4.0.37\webapps\ROOT\testPdoStatements.php:21: Fatal Error: Uncaught exception of type 'PDOException' with message 'SQLSTATE[S1000]: No operations allowed after statement closed'

The code is fairly simple. I get a connection, prepare 2 statements but when I execute the first, the error is thrown. If I only prepare the one statement and execute, it works fine. This is show stopper for us. We need to prepare multiple statements. Does anyone have an example?


$pdo = new PDO("java:comp/env/jdbc/mysql&quot;

// grumble

// preparations
$s = "select * from ItemCtlg where Str = :catalog";
$stmt1 = $pdo->prepare($s, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));
$stmt1->bindParam(':catalog', $Catalog, PDO::PARAM_STR);

$c = "select * from PartsOeStore where Str = :store";
$stmt2 = $pdo->prepare($c, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));
$stmt2->bindParam(':store', $Store, PDO::PARAM_STR);

// executions
$Catalog = 'myCatalog';
$Store = 'myStore';


==> produces error.
Reply With Quote
Old 01-02-2014, 04:40 PM
nam nam is offline
Join Date: Aug 2009
Posts: 337

Hi remaus,

I just fixed this for the upcoming 4.0.39 release. Let me know if you would like a snapshot release.
Reply With Quote

pdo, pdo_statements

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 06:55 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.