2007-07-23 20:38:41 +08:00
|
|
|
--TEST--
|
|
|
|
mysqli_stmt_init()
|
|
|
|
--SKIPIF--
|
2007-08-09 18:01:20 +08:00
|
|
|
<?php
|
|
|
|
require_once('skipif.inc');
|
|
|
|
require_once('skipifemb.inc');
|
|
|
|
require_once('skipifconnectfailure.inc');
|
|
|
|
?>
|
2007-07-23 20:38:41 +08:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
NOTE: no datatype tests here! This is done by
|
|
|
|
mysqli_stmt_bind_result.phpt already. Restrict
|
|
|
|
this test case to the basics.
|
|
|
|
*/
|
2009-10-20 04:07:25 +08:00
|
|
|
require_once("connect.inc");
|
2007-07-23 20:38:41 +08:00
|
|
|
|
|
|
|
$tmp = NULL;
|
|
|
|
$link = NULL;
|
|
|
|
|
|
|
|
if (!is_null($tmp = @mysqli_stmt_init()))
|
|
|
|
printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
|
|
|
|
|
|
|
|
if (!is_null($tmp = @mysqli_stmt_init($link)))
|
|
|
|
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
|
|
|
|
|
|
|
|
require('table.inc');
|
|
|
|
|
|
|
|
if (!is_object($stmt = mysqli_stmt_init($link)))
|
|
|
|
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
|
|
|
|
|
|
|
if (!is_object($stmt2 = @mysqli_stmt_init($link)))
|
|
|
|
printf("[003a] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
|
|
|
|
|
|
|
mysqli_stmt_close($stmt);
|
|
|
|
|
|
|
|
if (NULL !== ($tmp = mysqli_stmt_init($stmt)))
|
|
|
|
printf("[004] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
|
|
|
|
|
|
|
|
mysqli_close($link);
|
|
|
|
|
2017-10-30 03:16:56 +08:00
|
|
|
if (false !== ($tmp = mysqli_stmt_init($link)))
|
|
|
|
printf("[005] Expecting false, got %s/%s\n", gettype($tmp), $tmp);
|
2007-07-23 20:38:41 +08:00
|
|
|
|
|
|
|
print "done!";
|
|
|
|
?>
|
2009-07-06 22:36:52 +08:00
|
|
|
--CLEAN--
|
|
|
|
<?php
|
|
|
|
require_once("clean_table.inc");
|
|
|
|
?>
|
2007-07-23 20:38:41 +08:00
|
|
|
--EXPECTF--
|
|
|
|
Warning: mysqli_stmt_close(): invalid object or resource mysqli_stmt
|
|
|
|
in %s on line %d
|
|
|
|
|
|
|
|
Warning: mysqli_stmt_init() expects parameter 1 to be mysqli, object given in %s on line %d
|
2007-10-10 18:51:34 +08:00
|
|
|
|
|
|
|
Warning: mysqli_stmt_init(): Couldn't fetch mysqli in %s on line %d
|
2017-10-30 03:16:56 +08:00
|
|
|
done!
|