xref: /PHP-8.3/ext/mysqli/tests/041.phpt (revision a21edc52)
1--TEST--
2function test: mysqli_warning_count()
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8?>
9--FILE--
10<?php
11
12    require_once 'connect.inc';
13
14    /*** test mysqli_connect 127.0.0.1 ***/
15    $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
16    mysqli_select_db($link, $db);
17
18    mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
19    mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
20
21    var_dump(mysqli_warning_count($link));
22
23    mysqli_close($link);
24    print "done!";
25?>
26--CLEAN--
27<?php
28require_once 'connect.inc';
29if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
30   printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
31
32if (!mysqli_query($link, "DROP TABLE IF EXISTS test_warnings"))
33    printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
34
35mysqli_close($link);
36?>
37--EXPECT--
38int(1)
39done!
40