<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
- mysqli_select_db($link, "test");
+ mysqli_select_db($link, $db);
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
var_dump($num);
mysqli_close($link);
+ print "done!";
?>
--EXPECT--
int(1)
+done!
\ No newline at end of file
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
- mysqli_select_db($link, "test");
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
+ mysqli_select_db($link, $db);
mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
var_dump(mysqli_warning_count($link));
mysqli_close($link);
+ print "done!";
?>
--EXPECT--
int(1)
+done!
\ No newline at end of file
--FILE--
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
- mysqli_select_db($link, "test");
+ mysqli_select_db($link, $db);
mysqli_query($link, "SET sql_mode=''");
- mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
- mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
+ mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
+ mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
c2 smallint unsigned,
c3 smallint,
c4 smallint,
var_dump($test);
mysqli_close($link);
+ print "done!"
?>
--EXPECTF--
object(stdClass)#%d (7) {
["c7"]=>
string(1) "0"
}
+done!
--UEXPECTF--
object(stdClass)#%d (7) {
[u"c1"]=>
[u"c7"]=>
unicode(1) "0"
}
+done!
\ No newline at end of file
--FILE--
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
- mysqli_select_db($link, "test");
+ mysqli_select_db($link, $db);
- mysqli_query($link,"DROP TABLE IF EXISTS test_update");
- mysqli_query($link,"CREATE TABLE test_update(a varchar(10),
+ mysqli_query($link,"DROP TABLE IF EXISTS test_update");
+ mysqli_query($link,"CREATE TABLE test_update(a varchar(10),
b int)");
mysqli_query($link, "INSERT INTO test_update VALUES ('foo', 2)");
var_dump($test);
mysqli_close($link);
+ print "done!";
?>
--EXPECTF--
array(1) {
[0]=>
- %s(15) "Rasmus is No. 1"
+ string(15) "Rasmus is No. 1"
+}
+done!
+--UEXPECF--
+array(1) {
+ [0]=>
+ unicode(15) "Rasmus is No. 1"
}
+done!
\ No newline at end of file
--FILE--
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$i = mysqli_get_server_version($link);
var_dump($test);
mysqli_close($link);
+ print "done!";
?>
--EXPECT--
int(1)
+done!
\ No newline at end of file
--TEST--
mysqli_bind_result (SHOW)
--SKIPIF--
-<?php
+<?php
require_once('skipif.inc');
- require_once('skipifemb.inc');
+ require_once('skipifemb.inc');
include "connect.inc";
$link = mysqli_connect($host, $user, $passwd);
--FILE--
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
mysqli_execute($stmt);
- mysqli_bind_result($stmt, $c1, $c2);
+ mysqli_bind_result($stmt, $c1, $c2);
mysqli_fetch($stmt);
- mysqli_stmt_close($stmt);
+ mysqli_stmt_close($stmt);
$test = array ($c1,$c2);
var_dump($test);
mysqli_close($link);
+ print "done!";
?>
--EXPECTF--
array(2) {
[0]=>
- %s(4) "port"
+ string(4) "port"
+ [1]=>
+ string(%d) "%s"
+}
+done!
+--UEXPECTF--
+array(2) {
+ [0]=>
+ unicode(4) "port"
[1]=>
- %s(4) "%s"
+ unicode(%d) "%s"
}
+done!
\ No newline at end of file
--FILE--
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
- mysqli_select_db($link, "test");
+ mysqli_select_db($link, $db);
mysqli_query($link, "DROP TABLE IF EXISTS test_affected");
mysqli_query($link, "CREATE TABLE test_affected (foo int)");
mysqli_execute($stmt);
$x = mysqli_stmt_affected_rows($stmt);
- mysqli_stmt_close($stmt);
+ mysqli_stmt_close($stmt);
var_dump($x==1);
mysqli_close($link);
+ print "done!";
?>
--EXPECT--
bool(true)
+done!
\ No newline at end of file
--FILE--
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
+ $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
- mysqli_select_db($link, "test");
+ mysqli_select_db($link, $db);
mysqli_query($link, "DROP TABLE IF EXISTS test_affected");
mysqli_query($link, "CREATE TABLE test_affected (foo int, bar varchar(10) character set latin1)");
while ($field = mysqli_fetch_field($result)) {
var_dump($field);
}
-
+
print_r(mysqli_fetch_lengths($result));
-
+
mysqli_free_result($result);
- mysqli_stmt_close($stmt);
+ mysqli_stmt_close($stmt);
mysqli_close($link);
+ print "done!";
?>
--EXPECTF--
=== fetch_fields ===
["decimals"]=>
int(0)
}
+done!
--UEXPECTF--
=== fetch_fields ===
array(2) {
[u"decimals"]=>
int(0)
}
+done!
\ No newline at end of file
--TEST--
-mysqli bind_result (OO-Style)
+mysqli bind_result (OO-Style)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $mysql = mysqli_connect($host, $user, $passwd);
+ $mysql = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
- $mysql->select_db("test");
+ $mysql->select_db($db);
$mysql->query("DROP TABLE IF EXISTS test_fetch_null");
$mysql->query("CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint,
- col3 int, col4 bigint,
+ col3 int, col4 bigint,
col5 float, col6 double,
- col7 date, col8 time,
- col9 varbinary(10),
+ col7 date, col8 time,
+ col9 varbinary(10),
col10 varchar(50),
col11 char(20))");
-
+
$mysql->query("INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)");
$stmt = $mysql->prepare("SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null");
- $stmt->bind_result($c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
+ $stmt->bind_result($c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
$stmt->execute();
$stmt->fetch();
$stmt->close();
$mysql->close();
+ print "done!";
?>
--EXPECTF--
array(11) {
[8]=>
NULL
[9]=>
- %s(4) "foo1"
+ string(4) "foo1"
+ [10]=>
+ string(4) "1000"
+}
+done!
+--UEXPECTF--
+array(11) {
+ [0]=>
+ int(1)
+ [1]=>
+ NULL
+ [2]=>
+ NULL
+ [3]=>
+ NULL
+ [4]=>
+ NULL
+ [5]=>
+ NULL
+ [6]=>
+ NULL
+ [7]=>
+ NULL
+ [8]=>
+ NULL
+ [9]=>
+ unicode(4) "foo1"
[10]=>
- %s(4) "1000"
+ unicode(4) "1000"
}
+done!
\ No newline at end of file
--TEST--
-mysql_fetch_row (OO-Style)
+mysql_fetch_row (OO-Style)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
-
+
/*** test mysqli_connect 127.0.0.1 ***/
- $mysql = mysqli_connect($host, $user, $passwd);
+ $mysql = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
- $mysql->select_db("test");
+ $mysql->select_db($db);
$result = $mysql->query("SELECT DATABASE()");
$row = $result->fetch_row();
$result->close();
var_dump($row);
$mysql->close();
+ print "done!";
?>
--EXPECTF--
array(1) {
[0]=>
- %s(4) "test"
+ string(%d) "%s"
+}
+done!
+--UEXPECTF--
+array(1) {
+ [0]=>
+ unicode(%d) "%s"
}
+done!
\ No newline at end of file