mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
a4cd950dc8
verbose explanation of changes: - take connection parameter from connect.inc - use proper UEXPECTF - have 'print "done!"' or similar at the end to detect crashes - whitespace changes where needed - take care of portability: PHP 5 vs. PHP 5, MySQL 4.1 - 6.0 - understand return value checking as sometime that makes you type more when you write but makes you happy when you debug
35 lines
612 B
PHP
35 lines
612 B
PHP
--TEST--
|
|
mysqli warning_count, get_warnings
|
|
--SKIPIF--
|
|
<?php require_once('skipif.inc'); ?>
|
|
--FILE--
|
|
<?php
|
|
include "connect.inc";
|
|
|
|
$mysql = new mysqli($host, $user, $passwd, $db, $port, $socket);
|
|
|
|
$mysql->query("DROP TABLE IF EXISTS not_exists");
|
|
|
|
var_dump($mysql->warning_count);
|
|
|
|
$w = $mysql->get_warnings();
|
|
|
|
var_dump($w->errno);
|
|
var_dump($w->message);
|
|
var_dump($w->sqlstate);
|
|
|
|
$mysql->close();
|
|
echo "done!"
|
|
?>
|
|
--EXPECTF--
|
|
int(1)
|
|
int(1051)
|
|
string(26) "Unknown table 'not_exists'"
|
|
string(5) "HY000"
|
|
done!
|
|
--UEXPECTF--
|
|
int(1)
|
|
int(1051)
|
|
unicode(26) "Unknown table 'not_exists'"
|
|
unicode(5) "HY000"
|
|
done!
|