- session_is_registered()
- session_register()
- session_unregister()
+ - mysqli_bind_param() (alias of mysqli_stmt_bind_param())
+ - mysqli_bind_result() (alias of mysqli_stmt_bind_result())
+ - mysqli_client_encoding() (alias of mysqli_character_set_name())
+ - mysqli_fetch() (alias of mysqli_stmt_fetch())
+ - mysqli_param_count() (alias of mysqli_stmt_param_count())
+ - mysqli_get_metadata() (alias of mysqli_stmt_result_metadata())
+ - mysqli_send_long_data() (alias of mysqli_stmt_send_long_data())
+ - mysqli::client_encoding() (alias of mysqli::character_set_name)
+ - mysqli_stmt::stmt() (never worked/always throws, undocumented)
=============
8. Extensions
#endif
ZEND_BEGIN_ARG_INFO(arginfo_mysqli_stmt_bind_result, 1)
- ZEND_ARG_PASS_INFO(0)
+ MYSQLI_ZEND_ARG_OBJ_INFO_STMT()
ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO(arginfo_mysqli_stmt_bind_param, 1)
- ZEND_ARG_PASS_INFO(0)
- ZEND_ARG_PASS_INFO(0)
+ MYSQLI_ZEND_ARG_OBJ_INFO_STMT()
+ ZEND_ARG_INFO(0, types)
ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO(arginfo_class_mysqli_stmt_bind_result, 1)
ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO(arginfo_class_mysqli_stmt_bind_param, 1)
- ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_INFO(0, types)
ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO(all_args_force_by_ref, 1)
PHP_FE(mysqli_refresh, arginfo_mysqli_refresh)
/* Aliases */
- PHP_FALIAS(mysqli_bind_param, mysqli_stmt_bind_param, arginfo_mysqli_stmt_bind_param)
- PHP_FALIAS(mysqli_bind_result, mysqli_stmt_bind_result, arginfo_mysqli_stmt_bind_result)
- PHP_FALIAS(mysqli_client_encoding, mysqli_character_set_name, NULL)
PHP_FALIAS(mysqli_escape_string, mysqli_real_escape_string, arginfo_mysqli_query)
- PHP_FALIAS(mysqli_fetch, mysqli_stmt_fetch, NULL)
- PHP_FALIAS(mysqli_param_count, mysqli_stmt_param_count, NULL)
- PHP_FALIAS(mysqli_get_metadata, mysqli_stmt_result_metadata,NULL)
- PHP_FALIAS(mysqli_send_long_data, mysqli_stmt_send_long_data, NULL)
PHP_FALIAS(mysqli_set_opt, mysqli_options, NULL)
{NULL, NULL, NULL} /* Must be the last line in mysqli_functions[] */
PHP_FALIAS(autocommit, mysqli_autocommit, arginfo_class_mysqli_autocommit)
PHP_FALIAS(change_user,mysqli_change_user, arginfo_class_mysqli_change_user)
PHP_FALIAS(character_set_name, mysqli_character_set_name, arginfo_mysqli_no_params)
- PHP_FALIAS(client_encoding, mysqli_character_set_name, arginfo_mysqli_no_params) /* deprecated */
PHP_FALIAS(close, mysqli_close, arginfo_mysqli_no_params)
PHP_FALIAS(commit, mysqli_commit, arginfo_mysqli_no_params)
PHP_FALIAS(connect, mysqli_connect, arginfo_mysqli_connect)
printf("[004] Cannot insert records, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null ORDER BY col1");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
- mysqli_execute($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
+ mysqli_stmt_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
printf("[006] [%d] string\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch ORDER BY c1");
- mysqli_bind_result($stmt, $c1, $c2);
- mysqli_execute($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2);
+ mysqli_stmt_execute($stmt);
$i = 4;
while ($i--) {
- mysqli_fetch($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1, $c2);
var_dump($test);
}
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', '$a')");
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test[] = $c1;
$test[] = ($a == $c2) ? "32K String ok" : "32K String failed";
var_dump($test);
/* this will crash with libmysql from PHP 5.0.6 (or earlier) to 5.3.0 */
- mysqli_fetch($stmt);
+ mysqli_stmt_fetch($stmt);
mysqli_stmt_close($stmt);
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
- mysqli_execute($stmt);
- $rc = mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
+ mysqli_stmt_execute($stmt);
+ $rc = mysqli_stmt_fetch($stmt);
if (mysqli_get_server_version($link) < 50000) {
// 4.1 is faulty and will return big number for $c6
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch_uint");
- mysqli_bind_result($stmt, $c1, $c2);
- mysqli_execute($stmt);
- $rc = mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2);
+ mysqli_stmt_execute($stmt);
+ $rc = mysqli_stmt_fetch($stmt);
echo $c1, "\n", $c2, "\n";
sin(0.6), 1.00000000000001, 888888888888888)");
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8);
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8);
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
$c = array(0,0,0,0,0,0,0,0);
- $b_res= mysqli_bind_result($stmt, $c[0], $c[1], $c[2], $c[3], $c[4], $c[5], $c[6], $c[7]);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
- mysqli_fetch($stmt);
+ $b_res= mysqli_stmt_bind_result($stmt, $c[0], $c[1], $c[2], $c[3], $c[4], $c[5], $c[6], $c[7]);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
+ mysqli_stmt_fetch($stmt);
mysqli_stmt_close($stmt);
$result = mysqli_query($link, "select * from test_bind_result");
if (!$stmt = mysqli_prepare($link, "SELECT @dummy"))
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- mysqli_bind_result($stmt, $dummy);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $dummy);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
var_dump($dummy);
if (!$stmt = mysqli_prepare($link, "SELECT md5('bar'), database(), 'foo'"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- mysqli_bind_result($stmt, $c0, $c1, $c2);
- mysqli_execute($stmt);
+ mysqli_stmt_bind_result($stmt, $c0, $c1, $c2);
+ mysqli_stmt_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_fetch($stmt);
mysqli_stmt_close($stmt);
$test = array($c0, $c1, $c2);
if (!$stmt = mysqli_prepare($link, "SELECT @@autocommit"))
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- mysqli_bind_result($stmt, $c0);
- mysqli_execute($stmt);
+ mysqli_stmt_bind_result($stmt, $c0);
+ mysqli_stmt_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_fetch($stmt);
var_dump($c0);
if (!$stmt = mysqli_prepare($link, "INSERT INTO insert_read(col1,col10, col11, col6) VALUES (?,?,?,?)"))
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- mysqli_bind_param($stmt, "issd", $c1, $c2, $c3, $c4);
+ mysqli_stmt_bind_param($stmt, "issd", $c1, $c2, $c3, $c4);
$c1 = 1;
$c2 = "foo";
$c3 = "foobar";
$c4 = 3.14;
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
if (!$stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 FROM insert_read"))
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
- mysqli_execute($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
+ mysqli_stmt_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
c7 timestamp)");
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_result VALUES (?,?,?,?,?,?,?)");
- mysqli_bind_param($stmt, "sssssss", $d1, $d2, $d3, $d4, $d5, $d6, $d7);
+ mysqli_stmt_bind_param($stmt, "sssssss", $d1, $d2, $d3, $d4, $d5, $d6, $d7);
$d1 = "2002-01-02";
$d2 = "12:49:00";
$d6 = "2020";
$d7 = "1999-12-29";
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
- mysqli_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7);
+ mysqli_stmt_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text)");
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
- mysqli_bind_param($stmt, "ss", $q1, $q2);
+ mysqli_stmt_bind_param($stmt, "ss", $q1, $q2);
$q1 = "1234567890";
$q2 = "this is a test";
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2);
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
- mysqli_bind_param($stmt, "ss", $a1, $a2);
+ mysqli_stmt_bind_param($stmt, "ss", $a1, $a2);
$a1 = "1234567890";
$a2 = str_repeat("A1", 32000);
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test[] = $c1;
$test[] = ($a2 == $c2) ? "32K String ok" : "32K String failed";
c7 int)");
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)");
- mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
+ mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
$c1 = -23;
$c2 = 35999;
$c3 = NULL;
$c6 = -0;
$c7 = 0;
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
c7 smallint)");
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)");
- mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
+ mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
$c1 = -23;
$c2 = 35999;
$c6 = -0;
$c7 = 0;
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
c7 tinyint)");
$stmt = mysqli_prepare ($link, "INSERT INTO test_bind_fetch VALUES(?,?,?,?,?,?,?)");
- mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
+ mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
$c1 = -23;
$c2 = 300;
$c6 = 30;
$c7 = 0;
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,300,0,-100,-127,+30,0)");
$c1 = $c2 = $c3 = $c4 = $c5 = $c6 = $c7 = NULL;
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 varchar(10), c2 text)");
$stmt = mysqli_prepare ($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
- mysqli_bind_param($stmt, "sb", $c1, $c2);
+ mysqli_stmt_bind_param($stmt, "sb", $c1, $c2);
$c1 = "Hello World";
- mysqli_send_long_data($stmt, 1, "This is the first sentence.");
- mysqli_send_long_data($stmt, 1, " And this is the second sentence.");
- mysqli_send_long_data($stmt, 1, " And finally this is the last sentence.");
+ mysqli_stmt_send_long_data($stmt, 1, "This is the first sentence.");
+ mysqli_stmt_send_long_data($stmt, 1, " And this is the second sentence.");
+ mysqli_stmt_send_long_data($stmt, 1, " And finally this is the last sentence.");
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $d1, $d2);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $d1, $d2);
+ mysqli_stmt_execute($stmt);
+ mysqli_stmt_fetch($stmt);
$test = array($d1,$d2);
c7 smallint) ENGINE=" . $engine);
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)");
- mysqli_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
+ mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
$c1 = -23;
$c2 = 35999;
$c6 = -0;
$c7 = 0;
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$result = mysqli_query($link, "SELECT * FROM test_bind_fetch");
--TEST--
-mysqli_bind_param (UPDATE)
+mysqli_stmt_bind_param (UPDATE)
--SKIPIF--
<?php
require_once('skipif.inc');
mysqli_query($link, "INSERT INTO test_update VALUES ('foo', 2)");
$stmt = mysqli_prepare($link, "UPDATE test_update SET a=?,b=? WHERE b=?");
- mysqli_bind_param($stmt, "sii", $c1, $c2, $c3);
+ mysqli_stmt_bind_param($stmt, "sii", $c1, $c2, $c3);
$c1 = "Rasmus";
$c2 = 1;
$c3 = 2;
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$result = mysqli_query($link, "SELECT concat(a, ' is No. ', b) FROM test_update");
--TEST--
-mysqli_bind_result (SHOW)
+mysqli_stmt_bind_result (SHOW)
--SKIPIF--
<?php
require_once('skipif.inc');
$link = my_mysqli_connect($host, $user, $passwd);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
if (!$stmt->field_count) {
printf("skip SHOW command is not supported in prepared statements.");
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
- mysqli_bind_result($stmt, $c1, $c2);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $c1, $c2);
+ mysqli_stmt_fetch($stmt);
mysqli_stmt_close($stmt);
if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && mysqli_get_server_version($link) < 50000) {
/* variables are binary */
mysqli_query($link, "INSERT INTO test_affected VALUES (1),(2),(3),(4),(5)");
$stmt = mysqli_prepare($link, "DELETE FROM test_affected WHERE foo=?");
- mysqli_bind_param($stmt, "i", $c1);
+ mysqli_stmt_bind_param($stmt, "i", $c1);
$c1 = 2;
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
$x = mysqli_stmt_affected_rows($stmt);
mysqli_stmt_close($stmt);
--TEST--
-mysqli_get_metadata
+mysqli_stmt_result_metadata
--SKIPIF--
<?php
require_once('skipif.inc');
mysqli_query($link, "INSERT INTO test_affected VALUES (1, 'Zak'),(2, 'Greant')");
$stmt = mysqli_prepare($link, "SELECT * FROM test_affected");
- mysqli_execute($stmt);
- $result = mysqli_get_metadata($stmt);
+ mysqli_stmt_execute($stmt);
+ $result = mysqli_stmt_result_metadata($stmt);
echo "\n=== fetch_fields ===\n";
var_dump(mysqli_fetch_fields($result));
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$stmt = mysqli_prepare($link, "SELECT CURRENT_USER()");
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_close($link);
printf("Ok\n");
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$stmt1 = mysqli_prepare($link, "SELECT CURRENT_USER()");
- mysqli_execute($stmt1);
+ mysqli_stmt_execute($stmt1);
mysqli_close($link);
@mysqli_stmt_close($stmt1);
$stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
mysqli_close($link);
- @mysqli_execute($stmt2);
+ @mysqli_stmt_execute($stmt2);
@mysqli_stmt_close($stmt2);
printf("Ok\n");
?>
--TEST--
-mysqli_get_metadata
+mysqli_stmt_result_metadata
--SKIPIF--
<?php
require_once('skipif.inc');
mysqli_query($link, "INSERT INTO test_store_result VALUES (1),(2),(3)");
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
/* this should produce an out of sync error */
if ($result = mysqli_query($link, "SELECT * FROM test_store_result")) {
/* now we should try mysqli_stmt_reset() */
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
- var_dump(mysqli_execute($stmt));
+ var_dump(mysqli_stmt_execute($stmt));
var_dump(mysqli_stmt_reset($stmt));
var_dump($stmt = mysqli_prepare($link, "SELECT * FROM test_store_result"));
if ($IS_MYSQLND && $stmt->affected_rows !== -1)
printf("[001] Expecting -1, got %d\n", $stmt->affected_rows);
- var_dump(mysqli_execute($stmt));
+ var_dump(mysqli_stmt_execute($stmt));
var_dump($stmt = @mysqli_prepare($link, "SELECT * FROM test_store_result"), mysqli_error($link));
var_dump(mysqli_stmt_reset($stmt));
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
- mysqli_execute($stmt);
- $result1 = mysqli_get_metadata($stmt);
+ mysqli_stmt_execute($stmt);
+ $result1 = mysqli_stmt_result_metadata($stmt);
mysqli_stmt_store_result($stmt);
printf ("Rows: %d\n", mysqli_stmt_affected_rows($stmt));
$stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?,?)");
- mysqli_bind_param($stmt, "is", $a, $b);
+ mysqli_stmt_bind_param($stmt, "is", $a, $b);
$a = 1;
$b = "foo";
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
- mysqli_bind_param($stmt, "is", $c, $d);
+ mysqli_stmt_bind_param($stmt, "is", $c, $d);
$c = 2;
$d = "bar";
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM mbind");
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
- mysqli_bind_result($stmt, $e, $f);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $e, $f);
+ mysqli_stmt_fetch($stmt);
- mysqli_bind_result($stmt, $g, $h);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $g, $h);
+ mysqli_stmt_fetch($stmt);
var_dump((array($e,$f,$g,$h)));
$stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?||?)");
- mysqli_bind_param($stmt, "ss", $a, $b);
+ mysqli_stmt_bind_param($stmt, "ss", $a, $b);
$a = "foo";
$b = "bar";
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
$stmt = mysqli_prepare($link, "SELECT * FROM mbind");
- mysqli_execute($stmt);
+ mysqli_stmt_execute($stmt);
- mysqli_bind_result($stmt, $e);
- mysqli_fetch($stmt);
+ mysqli_stmt_bind_result($stmt, $e);
+ mysqli_stmt_fetch($stmt);
var_dump($e);
if (3 !== ($tmp = strlen($mysql->real_escape_string($esc_str))))
printf("[003] Expecting 3/int got %s/%s\n", gettype($tmp), $tmp);
- if ('latin1' !== ($tmp = $mysql->client_encoding()))
+ if ('latin1' !== ($tmp = $mysql->character_set_name()))
printf("[004] Expecting latin1/string got %s/%s\n", gettype($tmp), $tmp);
}
if (2 !== ($tmp = strlen($mysql->real_escape_string($esc_str))))
printf("[005] Expecting 2/int got %s/%s\n", gettype($tmp), $tmp);
- if ('gbk' !== ($tmp = $mysql->client_encoding()))
+ if ('gbk' !== ($tmp = $mysql->character_set_name()))
printf("[005] Expecting gbk/string got %s/%s\n", gettype($tmp), $tmp);;
}
}
}
}
- $charset2 = mysqli_client_encoding($link);
+ $charset2 = mysqli_character_set_name($link);
if ($charset2 !== $charset) {
- printf("[012] Alias mysqli_client_encoding returned %s/%s, expected %s/%s\n", gettype($charset2), $charset2, gettype($charset), $charset);
+ printf("[012] Alias mysqli_character_set_name returned %s/%s, expected %s/%s\n", gettype($charset2), $charset2, gettype($charset), $charset);
}
mysqli_close($link);
printf("[013] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
/* Make sure that the function alias exists */
- if (!is_null($tmp = @mysqli_client_encoding()))
+ if (!is_null($tmp = @mysqli_character_set_name()))
printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
print "done!";
$charset2 = $mysqli->character_set_name();
if ($charset2 !== $charset) {
- printf("[012] Alias mysqli_client_encoding returned %s/%s, expected %s/%s\n",
+ printf("[012] Alias mysqli_character_set_name returned %s/%s, expected %s/%s\n",
gettype($charset2), $charset2, gettype($charset), $charset);
}
printf("[013] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
/* Make sure that the function alias exists */
- if (!is_null($tmp = @$mysqli->client_encoding()))
+ if (!is_null($tmp = @$mysqli->character_set_name()))
printf("[014] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
print "done!";
printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$id = 1;
- if (!mysqli_bind_param($stmt, 'i', $id) || !mysqli_stmt_execute($stmt))
+ if (!mysqli_stmt_bind_param($stmt, 'i', $id) || !mysqli_stmt_execute($stmt))
printf("[010] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_stmt_close($stmt);
printf("[011] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$id = 2;
- if (!mysqli_bind_param($stmt, 'i', $id) || !mysqli_stmt_execute($stmt))
+ if (!mysqli_stmt_bind_param($stmt, 'i', $id) || !mysqli_stmt_execute($stmt))
printf("[012] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_stmt_close($stmt);
$id = 3;
$where = 2;
- if (!mysqli_bind_param($stmt, 'ii', $id, $where) || !mysqli_stmt_execute($stmt))
+ if (!mysqli_stmt_bind_param($stmt, 'ii', $id, $where) || !mysqli_stmt_execute($stmt))
printf("[014] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_stmt_close($stmt);
printf("[015] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$where = 3;
- if (!mysqli_bind_param($stmt, 'i', $where) || !mysqli_stmt_execute($stmt))
+ if (!mysqli_stmt_bind_param($stmt, 'i', $where) || !mysqli_stmt_execute($stmt))
printf("[016] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_stmt_close($stmt);
printf("[017] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$testvar = 'testvar';
- if (!mysqli_bind_param($stmt, 's', $testvar) || !mysqli_stmt_execute($stmt))
+ if (!mysqli_stmt_bind_param($stmt, 's', $testvar) || !mysqli_stmt_execute($stmt))
printf("[018] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_stmt_close($stmt);
/* Check that the function alias exists. It's a deprecated function,
but we have not announce the removal so far, therefore we need to check for it */
- if (!is_null($tmp = @mysqli_bind_param()))
+ if (!is_null($tmp = @mysqli_stmt_bind_param()))
printf("[021] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
print "done!";
?>
/* Check that the function alias exists. It's a deprecated function,
but we have not announce the removal so far, therefore we need to check for it */
- if (!is_null($tmp = @mysqli_bind_result()))
+ if (!is_null($tmp = @mysqli_stmt_bind_result()))
printf("[3000] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
$stmt = mysqli_stmt_init($link);
/* Check that the function alias exists. It's a deprecated function,
but we have not announce the removal so far, therefore we need to check for it */
- if (!is_null($tmp = @mysqli_fetch()))
+ if (!is_null($tmp = @mysqli_stmt_fetch()))
printf("[017] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
print "done!";
/* Check that the function alias exists. It's a deprecated function,
but we have not announce the removal so far, therefore we need to check for it */
- if (!is_null($tmp = @mysqli_param_count()))
+ if (!is_null($tmp = @mysqli_stmt_param_count()))
printf("[041] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
print "done!";
/* Check that the function alias exists. It's a deprecated function,
but we have not announce the removal so far, therefore we need to check for it */
- if (!is_null($tmp = @mysqli_get_metadata()))
+ if (!is_null($tmp = @mysqli_stmt_result_metadata()))
printf("[018] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
mysqli_close($link);
/* Check that the function alias exists. It's a deprecated function,
but we have not announce the removal so far, therefore we need to check for it */
- if (!is_null($tmp = @mysqli_send_long_data()))
+ if (!is_null($tmp = @mysqli_stmt_send_long_data()))
printf("[023] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
mysqli_close($link);