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