php-sqlsrv/test/bvt/pdo_sqlsrv/msdn_pdoStatement_errorCode.phpt
2017-06-02 15:59:44 -07:00

20 lines
421 B
PHP

--TEST--
shows the error code of a SQL query with a mispelled table
--SKIPIF--
--FILE--
<?php
require('connect.inc');
$conn = new PDO( "sqlsrv:server=$server; Database = $databaseName", "$uid", "$pwd");
$stmt = $conn->prepare('SELECT * FROM Person.Addressx');
$stmt->execute();
echo "Error Code: ";
print $stmt->errorCode();
// free the statement and connection
$stmt=null;
$conn=null;
?>
--EXPECT--
Error Code: 42S02