Annotation of embedaddon/php/ext/mysqli/tests/066.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: function test: mysqli_warning object
3: --SKIPIF--
4: <?php
5: require_once('skipif.inc');
6: require_once('skipifconnectfailure.inc');
7: ?>
8: --FILE--
9: <?php
10: require_once("connect.inc");
11:
12: /*** test mysqli_connect 127.0.0.1 ***/
13: $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
14:
15: $mysql->query("DROP TABLE IF EXISTS test_warnings");
16:
17: $mysql->query("CREATE TABLE test_warnings (a int not null) ENGINE=myisam");
18:
19: $mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)");
20:
21: if (($warning = $mysql->get_warnings())) {
22: do {
23: printf("Warning\n");
24: } while ($warning->next());
25: }
26:
27: $mysql->close();
28: print "done!";
29: ?>
30: --CLEAN--
31: <?php
32: require_once("connect.inc");
33: if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
34: printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
35:
36: if (!mysqli_query($link, "DROP TABLE IF EXISTS test_warnings"))
37: printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
38:
39: mysqli_close($link);
40: ?>
41: --EXPECT--
42: Warning
43: done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>