2003-02-12 00:46:29 +00:00
|
|
|
--TEST--
|
2008-01-08 12:49:42 +00:00
|
|
|
mysqli fetch functions
|
2004-12-04 08:50:33 +00:00
|
|
|
--SKIPIF--
|
2008-01-08 12:49:42 +00:00
|
|
|
<?php
|
2007-10-10 10:07:08 +00:00
|
|
|
require_once('skipif.inc');
|
|
|
|
require_once('skipifemb.inc');
|
|
|
|
require_once('skipifconnectfailure.inc');
|
|
|
|
?>
|
2003-02-12 00:46:29 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
include "connect.inc";
|
2008-01-08 12:49:42 +00:00
|
|
|
|
2003-02-12 00:46:29 +00:00
|
|
|
/*** test mysqli_connect 127.0.0.1 ***/
|
2007-10-10 10:07:08 +00:00
|
|
|
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
2003-02-12 00:46:29 +00:00
|
|
|
|
2007-10-10 10:07:08 +00:00
|
|
|
if (!$stmt = mysqli_prepare($link, "SELECT md5('bar'), database(), 'foo'"))
|
|
|
|
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
2003-02-12 00:46:29 +00:00
|
|
|
|
2008-01-08 12:49:42 +00:00
|
|
|
mysqli_bind_result($stmt, $c0, $c1, $c2);
|
2003-02-12 00:46:29 +00:00
|
|
|
mysqli_execute($stmt);
|
|
|
|
|
|
|
|
mysqli_fetch($stmt);
|
2004-12-04 08:16:04 +00:00
|
|
|
mysqli_stmt_close($stmt);
|
|
|
|
|
2004-02-11 07:39:28 +00:00
|
|
|
$test = array($c0, $c1, $c2);
|
2007-10-10 10:07:08 +00:00
|
|
|
if ($c1 !== $db) {
|
|
|
|
echo "Different data\n";
|
|
|
|
}
|
2003-02-12 00:46:29 +00:00
|
|
|
|
|
|
|
var_dump($test);
|
|
|
|
mysqli_close($link);
|
2007-10-10 10:07:08 +00:00
|
|
|
print "done!";
|
2003-02-12 00:46:29 +00:00
|
|
|
?>
|
2007-10-10 10:07:08 +00:00
|
|
|
--EXPECTF--
|
2004-02-16 15:32:46 +00:00
|
|
|
array(3) {
|
2003-02-12 00:46:29 +00:00
|
|
|
[0]=>
|
2006-03-24 10:58:52 +00:00
|
|
|
string(32) "37b51d194a7513e45b56f6524f2d51f2"
|
2003-02-12 00:46:29 +00:00
|
|
|
[1]=>
|
2009-05-28 14:33:43 +00:00
|
|
|
%unicode|string%(%d) "%s"
|
2004-02-16 15:32:46 +00:00
|
|
|
[2]=>
|
2009-05-28 14:33:43 +00:00
|
|
|
%unicode|string%(3) "foo"
|
2003-02-12 00:46:29 +00:00
|
|
|
}
|
2009-05-28 14:33:43 +00:00
|
|
|
done!
|