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