Skip to content

Commit 96765f2

Browse files
author
dome
committed
Add .phpt test for last_query_error property on failed mysqli queries
1 parent 84f457e commit 96765f2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/mysqli/last_query_error.phpt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
Test last_query_error property on failed query
3+
--FILE--
4+
<?php
5+
try {
6+
$mysqli = new mysqli("localhost", "user", "pass", "database");
7+
$mysqli->query("SELECT * FROM unknown_table");
8+
} catch(mysqli_sql_exception $e) {
9+
echo $mysqli->last_query_error;
10+
}
11+
--EXPECT--
12+
Test passed
13+
?>

0 commit comments

Comments
 (0)