--TEST-- Retrieve error information; supplied values does not match table definition --SKIPIF-- --FILE-- exec($sql); // Insert data using bind parameters // Number of supplied values does not match table definition $sql = "INSERT INTO $tableName VALUES (?,?)"; $stmt = $conn->prepare($sql); $params = array(2010, "London"); // SQL statement has an error, which is then reported if ($stmt) { $stmt->execute($params); } } catch (PDOException $e) { $error = $e->errorInfo; $success = false; if (!isAEConnected()) { // 21S01 is the expected ODBC Column name or number of supplied values does not match table definition error if ($error[0] === "21S01") { $success = true; } } else { // 07009 is the expected ODBC Invalid Descriptor Index error if ($error[0] === "07009") { $success = true; } } if ($success) { print "Done"; } else { var_dump($error); } } finally { // Clean up and close connection dropTable($conn, $tableName); unset($stmt); unset($conn); } ?> --EXPECT-- Done