Bug #68957 [Com]: PDO::query doesn't support several queries

From: Date: Mon, 22 Jun 2015 17:17:12 +0000
Subject: Bug #68957 [Com]: PDO::query doesn't support several queries
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193764@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68957&edit=1 ID: 68957 Comment by: maxiwheat at gmail dot com Reported by: manal at free dot fr Summary: PDO::query doesn't support several queries Status: Open Type: Bug Package: PDO DBlib Operating System: Linux PHP Version: 5.6.5 Block user comment: N Private report: N New Comment: Looks related to https://bugs.php.net/bug.php?id=69592 Actual result is in the second resultset. You can run your example code adding one line to see it : <?php $db = new PDO('dblib:host=myhost;dbname=master','user','password'); $query = "declare @myInt int = 1; select @myInt;"; $stmt = $db->query($query); $stmt->nextRowset(); // Added line $rows = $stmt->fetchAll(); print_r($rows); ?> Previous Comments: ------------------------------------------------------------------------ [2015-01-30 09:23:37] manal at free dot fr Description: ------------ The script below should return one row, but it doesn't. The same queries executed by mssql_query work fine. Test script: --------------- <?php $db = new PDO('dblib:host=myhost;dbname=master','user','password'); $query = "declare @myInt int = 1; select @myInt;"; $stmt = $db->query($query); $rows = $stmt->fetchAll(); print_r($rows); ?> Expected result: ---------------- Array ( [0] => Array ( [computed] => 1 [0] => 1 ) ) Actual result: -------------- Array ( ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68957&edit=1

« previous php.bugs (#193764) next »