php-src/ext/mysqli/tests/045.phpt

53 lines
1.1 KiB
Plaintext
Raw Normal View History

2003-02-14 19:49:35 +00:00
--TEST--
mysqli_bind_result (SHOW)
--SKIPIF--
2007-10-10 10:08:29 +00:00
<?php
2006-03-30 20:43:39 +00:00
require_once('skipif.inc');
2007-10-10 10:08:29 +00:00
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
include "connect.inc";
$link = mysqli_connect($host, $user, $passwd);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
mysqli_execute($stmt);
if (!$stmt->field_count) {
printf("skip SHOW command is not supported in prepared statements.");
}
$stmt->close();
mysqli_close($link);
?>
2003-02-14 19:49:35 +00:00
--FILE--
<?php
include "connect.inc";
2007-10-10 10:08:29 +00:00
2003-02-14 19:49:35 +00:00
/*** test mysqli_connect 127.0.0.1 ***/
2007-10-10 10:08:29 +00:00
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
2003-02-14 19:49:35 +00:00
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
mysqli_execute($stmt);
2007-10-10 10:08:29 +00:00
mysqli_bind_result($stmt, $c1, $c2);
2003-02-14 19:49:35 +00:00
mysqli_fetch($stmt);
2007-10-10 10:08:29 +00:00
mysqli_stmt_close($stmt);
if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && mysqli_get_server_version($link) < 50000) {
2007-10-10 10:08:29 +00:00
/* variables are binary */
settype($c1, "unicode");
settype($c2, "unicode");
}
2003-02-14 19:49:35 +00:00
$test = array ($c1,$c2);
var_dump($test);
mysqli_close($link);
2007-10-10 10:08:29 +00:00
print "done!";
2003-02-14 19:49:35 +00:00
?>
2007-10-10 10:08:29 +00:00
--EXPECTF--
2003-02-14 19:49:35 +00:00
array(2) {
[0]=>
%unicode|string%(4) "port"
2007-10-10 10:08:29 +00:00
[1]=>
%unicode|string%(%d) "%s"
2003-02-14 19:49:35 +00:00
}
done!