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

74 lines
1.2 KiB
Plaintext
Raw Normal View History

2003-07-15 10:36:18 +00:00
--TEST--
multiple binds
2004-12-04 08:50:33 +00:00
--SKIPIF--
2007-10-10 10:08:29 +00:00
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
2003-07-15 10:36:18 +00:00
--FILE--
<?php
include "connect.inc";
2007-10-10 10:08:29 +00:00
2003-07-15 10:36:18 +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-07-15 10:36:18 +00:00
2007-10-10 10:08:29 +00:00
mysqli_select_db($link, $db);
2003-07-15 10:36:18 +00:00
2007-10-10 10:08:29 +00:00
mysqli_query($link,"DROP TABLE IF EXISTS mbind");
mysqli_query($link,"CREATE TABLE mbind (a int, b varchar(10))");
2003-07-15 10:36:18 +00:00
$stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?,?)");
2007-10-10 10:08:29 +00:00
mysqli_bind_param($stmt, "is", $a, $b);
2003-07-15 10:36:18 +00:00
$a = 1;
$b = "foo";
mysqli_execute($stmt);
mysqli_bind_param($stmt, "is", $c, $d);
2003-07-15 10:36:18 +00:00
$c = 2;
$d = "bar";
mysqli_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM mbind");
mysqli_execute($stmt);
mysqli_bind_result($stmt, $e, $f);
mysqli_fetch($stmt);
mysqli_bind_result($stmt, $g, $h);
mysqli_fetch($stmt);
var_dump((array($e,$f,$g,$h)));
mysqli_close($link);
2007-10-10 10:08:29 +00:00
print "done!";
2003-07-15 10:36:18 +00:00
?>
2007-10-10 10:08:29 +00:00
--EXPECTF--
2003-07-15 10:36:18 +00:00
array(4) {
[0]=>
int(1)
[1]=>
string(3) "foo"
[2]=>
int(2)
[3]=>
string(3) "bar"
}
2007-10-10 10:08:29 +00:00
done!
--UEXPECTF--
array(4) {
[0]=>
int(1)
[1]=>
unicode(3) "foo"
[2]=>
int(2)
[3]=>
unicode(3) "bar"
}
done!