php-sqlsrv/test/pdo_sqlsrv/pdostatement_columnCount.phpt
2017-05-04 08:14:10 -07:00

24 lines
506 B
PHP

--TEST--
Test PDOStatement::columnCount if the number of the columns in a result set.
--SKIPIF--
<?php require('skipif.inc'); ?>
--FILE--
<?php
require_once 'MsCommon.inc';
try
{
$db = connect();
$sql = "SELECT * FROM PDO_AllTypes";
$stmt = $db->prepare($sql);
$stmt->execute();
print_r("Existing table contains: " . $stmt->columnCount());
}
catch(PDOException $e)
{
var_dump($e);
}
?>
--EXPECT--
Existing table contains: 31