xref: /PHP-8.1/ext/mysqli/tests/031.phpt (revision b5a14e6c)
1--TEST--
2function test: mysqli_error
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once('skipifconnectfailure.inc');
8?>
9--FILE--
10<?php
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    $error = mysqli_error($link);
16    var_dump($error);
17
18    mysqli_select_db($link, $db);
19
20    mysqli_query($link, "SELECT * FROM non_exisiting_table");
21    $error = mysqli_error($link);
22
23    var_dump($error);
24
25    mysqli_close($link);
26    print "done!";
27?>
28--EXPECTF--
29string(0) ""
30string(%d) "%s"
31done!
32