1--TEST-- 2PDO_DBLIB: driver supports multiple queries in a single \PDO::query() call that doesn't return any rowsets 3--SKIPIF-- 4<?php 5if (!extension_loaded('pdo_dblib')) die('skip not loaded'); 6require dirname(__FILE__) . '/config.inc'; 7 8if (!driver_supports_batch_statements_without_select($db)) die('xfail test will fail with this version of FreeTDS'); 9?> 10--FILE-- 11<?php 12require dirname(__FILE__) . '/config.inc'; 13 14$stmt = $db->query( 15"create table #php_pdo(id int);" . 16"insert into #php_pdo values(1), (2), (3);" . 17"update #php_pdo set id = 1;" . 18"insert into #php_pdo values(2);" . 19"drop table #php_pdo;" 20); 21 22// check results from the create table 23var_dump($stmt->rowCount()); 24var_dump($stmt->nextRowset()); 25 26// check results from the first insert 27var_dump($stmt->rowCount()); 28var_dump($stmt->nextRowset()); 29 30// check results from the update 31var_dump($stmt->rowCount()); 32var_dump($stmt->nextRowset()); 33 34// check results from the second insert 35var_dump($stmt->rowCount()); 36var_dump($stmt->nextRowset()); 37 38// check results from the drop 39var_dump($stmt->rowCount()); 40var_dump($stmt->nextRowset()); 41 42// check that there are no more results 43var_dump($stmt->rowCount()); 44var_dump($stmt->nextRowset()); 45 46?> 47--EXPECT-- 48int(-1) 49bool(true) 50int(3) 51bool(true) 52int(3) 53bool(true) 54int(1) 55bool(true) 56int(-1) 57bool(false) 58int(-1) 59bool(false) 60