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

33 lines
614 B
PHP

--TEST--
Test the PDO::errorCode() and PDO::errorInfo() methods.
--SKIPIF--
<?php require('skipif.inc'); ?>
--FILE--
<?php
require_once 'MsCommon.inc';
try
{
$db = connect();
// query with a wrong column name.
$db->query( "Select * from " . $table1 . " where IntColX = 1" );
}
catch( PDOException $e ) {
print($db->errorCode());
echo "\n";
print_r($db->errorInfo());
exit;
}
?>
--EXPECTREGEX--
42S22
Array
\(
\[0\] => 42S22
\[1\] => 207
\[2\] => \[Microsoft\]\[ODBC Driver (09|10|11|12|13) for SQL Server\]\[SQL Server\]Invalid column name 'IntColX'\.
\)