xref: /PHP-8.4/ext/mysqli/tests/072.phpt (revision a21edc52)
1--TEST--
2mysqli warning_count, get_warnings
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8?>
9--FILE--
10<?php
11    require_once 'connect.inc';
12
13    $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
14
15    $mysql->query("DROP TABLE IF EXISTS not_exists");
16
17    var_dump($mysql->warning_count);
18
19    $w = $mysql->get_warnings();
20
21    var_dump($w->errno);
22    var_dump($w->message);
23    var_dump($w->sqlstate);
24
25    $mysql->close();
26    echo "done!"
27?>
28--EXPECTF--
29int(1)
30int(1051)
31string(%d) "Unknown table %snot_exists%s"
32string(5) "HY000"
33done!
34