if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE = ' . $engine))
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, "a")'))
+ if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (1, 'a')"))
printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (1 !== ($tmp = mysqli_affected_rows($link)))
printf("[010] Expecting int/1, got %s/%s\n", gettype($tmp), $tmp);
// ignore INSERT error, NOTE: command line returns 0, affected_rows returns -1 as documented
- mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, "a")');
+ mysqli_query($link, "INSERT INTO test(id, label) VALUES (1, 'a')");
if (-1 !== ($tmp = mysqli_affected_rows($link)))
printf("[011] Expecting int/-1, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, "a") ON DUPLICATE KEY UPDATE id = 4'))
+ if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (1, 'a') ON DUPLICATE KEY UPDATE id = 4"))
printf("[012] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (2 !== ($tmp = mysqli_affected_rows($link)))
print "done!";
?>
--EXPECTF--
-done!
\ No newline at end of file
+done!
if (!$mysqli->query('CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE = ' . $engine))
printf("[004] [%d] %s\n", $mysqli->errno, $mysqli->error);
- if (!$mysqli->query('INSERT INTO test(id, label) VALUES (1, "a")'))
+ if (!$mysqli->query("INSERT INTO test(id, label) VALUES (1, 'a')"))
printf("[005] [%d] %s\n", $mysqli->errno, $mysqli->error);
if (1 !== ($tmp = $mysqli->affected_rows))
if (-1 !== ($tmp = $mysqli->affected_rows))
printf("[007] Expecting int/-1, got %s/%s\n", gettype($tmp), $tmp);
- if (!$mysqli->query('INSERT INTO test(id, label) VALUES (1, "a") ON DUPLICATE KEY UPDATE id = 4'))
+ if (!$mysqli->query("INSERT INTO test(id, label) VALUES (1, 'a') ON DUPLICATE KEY UPDATE id = 4"))
printf("[008] [%d] %s\n", $mysqli->errno, $mysqli->error);
if (2 !== ($tmp = $mysqli->affected_rows))
print "done!";
?>
--EXPECTF--
-done!
\ No newline at end of file
+done!
if (!mysqli_query($link, 'CREATE TABLE test(id INT AUTO_INCREMENT PRIMARY KEY, label CHAR(10))'))
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (100, "z")'))
+ if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (100, 'z')"))
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (($insert_id = mysqli_insert_id($link)) !== 100)
print "done!";
?>
--EXPECTF--
-done!
\ No newline at end of file
+done!
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
- if (!$stmt = mysqli_prepare($link, 'SELECT "prepared statements should be released"'))
- printf("[002] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
+ if (!$stmt = mysqli_prepare($link, "SELECT 'prepared statements should be released'"))
+ printf("[002] [%d] %s\n", mysqli_errno(), mysqli_error());
mysqli_change_user($link, $user, $passwd, $db);
print "done!";
?>
--EXPECTF--
-done!
\ No newline at end of file
+done!
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
- if (!$res = mysqli_query($link, 'SHOW CHARACTER SET LIKE "latin%"'))
+ if (!$res = mysqli_query($link, "SHOW CHARACTER SET LIKE 'latin%'"))
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$charsets = array();
if (isset($not_changed['charset_client']) &&
$charset != $not_changed['charset_client'] &&
- mysqli_query($link, sprintf('SET @@character_set_client = "%s"', $charset)))
+ mysqli_query($link, sprintf("SET @@character_set_client = '%s'", $charset)))
unset($not_changed['charset_client']);
if (isset($not_changed['charset_connection']) &&
$charset != $not_changed['charset_connection'] &&
- mysqli_query($link, sprintf('SET @@character_connection = "%s"', $charset)))
+ mysqli_query($link, sprintf("SET @@character_connection = '%s'", $charset)))
unset($not_changed['charset_connection']);
if (isset($not_changed['charset_results']) &&
$charset != $not_changed['charset_results'] &&
- mysqli_query($link, sprintf('SET @@character_set_results = "%s"', $charset)))
+ mysqli_query($link, sprintf("SET @@character_set_results = '%s'", $charset)))
unset($not_changed['charset_results']);
if (isset($not_changed['collation_connection']) &&
$collation != $not_changed['collation_connection'] &&
- mysqli_query($link, sprintf('SET @@collation_connection = "%s"', $collation)))
+ mysqli_query($link, sprintf("SET @@collation_connection = '%s'", $collation)))
unset($not_changed['collation_connection']);
if (isset($not_changed['collation_database']) &&
$collation != $not_changed['collation_database'] &&
- mysqli_query($link, sprintf('SET @@collation_database = "%s"', $collation)))
+ mysqli_query($link, sprintf("SET @@collation_database = '%s'", $collation)))
unset($not_changed['collation_database']);
if (isset($not_changed['collation_server']) &&
$collation != $not_changed['collation_server'] &&
- mysqli_query($link, sprintf('SET @@collation_server = "%s"', $collation)))
+ mysqli_query($link, sprintf("SET @@collation_server = '%s'", $collation)))
unset($not_changed['collation_server']);
if (empty($not_changed))
print "done!";
?>
--EXPECTF--
-done!
\ No newline at end of file
+done!
MYSQLI_TYPE_DATETIME => array('DATETIME', '2007-08-20 18:42:01'),
MYSQLI_TYPE_YEAR => array('YEAR', '2007'),
MYSQLI_TYPE_ENUM => array('ENUM("everything", "is", "just", "wonderful")', 'is'),
- // MYSQLI_TYPE_SET => array('SET("I", "smash", "the")', 'I,smash,the'), - string
+ // MYSQLI_TYPE_SET => array("SET('I', 'smash', 'the')", 'I,smash,the'), - string
// MYSQLI_TYPE_TINY_BLOB => array("TINYBLOB", "I got a tiny blog"), - blob
// MYSQLI_TYPE_MEDIUM_BLOB => array("MEDIUMBLOB", "No blob for masses"), - blob
// MYSQLI_TYPE_LONG_BLOB => array("LONGBLOB", "Small is beautiful?"), - blob
MYSQLI_TYPE_VAR_STRING => array("VARCHAR(32768)", 'varchar'),
MYSQLI_TYPE_STRING => 'MYSQLI_TYPE_STRING - TODO add testing',
MYSQLI_TYPE_STRING => array('CHAR(1)', 'a'),
- MYSQLI_TYPE_STRING => array('SET("I", "smash", "the")', 'Will be converted to string although it is a SET...'),
+ MYSQLI_TYPE_STRING => array("SET('I', 'smash', 'the')", 'Will be converted to string although it is a SET...'),
MYSQLI_TYPE_NULL => 'MYSQLI_TYPE_NULL - TODO add testing',
MYSQLI_TYPE_NEWDATE => 'MYSQLI_TYPE_NEWDATE - TODO add testing',
MYSQLI_TYPE_INTERVAL => 'MYSQLI_TYPE_INTERVAL - TODO add testing',
print "done!";
?>
--EXPECTF--
-done!
\ No newline at end of file
+done!
var_dump($link->field_count);
var_dump(mysqli_field_count($link));
- if (!$res = mysqli_query($link, 'SELECT NULL as _null, "" AS "", "three" AS "drei"'))
+ if (!$res = mysqli_query($link, "SELECT NULL as _null, '' AS '', 'three' AS 'drei'"))
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
var_dump(mysqli_field_count($link));
mysqli_free_result($res);
Warning: mysqli_field_count(): Couldn't fetch mysqli in %s on line %d
NULL
-done!
\ No newline at end of file
+done!
if (!($character_set_connection = $tmp['charset']) || !($collation_connection = $tmp['collation']))
printf("[008] Cannot determine current character set and collation\n");
- if (!$res = mysqli_query($link, $sql = sprintf('SHOW CHARACTER SET LIKE "%s"', $character_set_connection)))
+ if (!$res = mysqli_query($link, $sql = sprintf("SHOW CHARACTER SET LIKE '%s'", $character_set_connection)))
printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$tmp = mysqli_fetch_assoc($res);
if (empty($tmp))
$maxlen = (isset($tmp['Maxlen'])) ? $tmp['Maxlen'] : '';
$comment = (isset($tmp['Description'])) ? $tmp['Description'] : '';
- if (!$res = mysqli_query($link, sprintf('SHOW COLLATION LIKE "%s"', $collation_connection)))
+ if (!$res = mysqli_query($link, sprintf("SHOW COLLATION LIKE '%s'", $collation_connection)))
printf("[011] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$tmp = mysqli_fetch_assoc($res);
mysqli_free_result($res);
if (!($id = $tmp['Id']))
printf("[012] Cannot fetch Id/Number, test will fail\n");
- if (!$res = mysqli_query($link, sprintf('SHOW VARIABLES LIKE "character_sets_dir"')))
+ if (!$res = mysqli_query($link, sprintf("SHOW VARIABLES LIKE 'character_sets_dir'")))
printf("[013] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$tmp = mysqli_fetch_assoc($res);
mysqli_free_result($res);
printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
require "table.inc";
- if (!$res = mysqli_query($link, 'INSERT INTO test(id, label) VALUES (100, "a")'))
+ if (!$res = mysqli_query($link, "INSERT INTO test(id, label) VALUES (100, 'a')"))
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
// NOTE: empty string, no multiple insert syntax
if (!is_string($tmp = mysqli_info($link)) || ('' != $tmp))
printf("[004] Expecting string/empty, got %s/%s\n", gettype($tmp), $tmp);
- if (!$res = mysqli_query($link, 'INSERT INTO test(id, label) VALUES (101, "a"), (102, "b")'))
+ if (!$res = mysqli_query($link, "INSERT INTO test(id, label) VALUES (101, 'a'), (102, 'b')"))
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (!is_string($tmp = mysqli_info($link)) || ('' == $tmp))
if (!is_string($tmp = mysqli_info($link)) || ('' == $tmp))
printf("[010] Expecting string/any_non_empty, got %s/%s\n", gettype($tmp), $tmp);
- if (!$res = mysqli_query($link, 'UPDATE test SET label = "b" WHERE id >= 100'))
+ if (!$res = mysqli_query($link, "UPDATE test SET label = 'b' WHERE id >= 100"))
printf("[011] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (!is_string($tmp = mysqli_info($link)) || ('' == $tmp))
print "done!";
?>
--EXPECTF--
-done!
\ No newline at end of file
+done!
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s, [%d] %s\n",
$host, $user, $db, $port, $socket, mysqli_connect_errno(), mysqli_connect_error());
}
- if (!mysqli_query($link1, 'SET @pcondisabled = "Connection 1"'))
+ if (!mysqli_query($link1, "SET @pcondisabled = 'Connection 1'"))
printf("[002] Cannot set user variable to check if we got the same persistent connection, [%d] %s\n",
mysqli_errno($link1), mysqli_error($link1));
Warning: mysqli_connect(): Persistent connections are disabled. Downgrading to normal in %s on line %d
Connecction 1 - SELECT @pcondisabled -> 'Connection 1'
Connecction 2 - SELECT @pcondisabled -> ''
-done!
\ No newline at end of file
+done!
// opens a regular connection
require_once("table.inc");
- if (!$res = mysqli_query($link, 'SELECT "works.." as _desc'))
+ if (!$res = mysqli_query($link, "SELECT 'works..' as _desc"))
printf("[001] Cannot run query, [%d] %s\n",
mysqli_errno($link), mysqli_error($link));
printf("[002] Cannot open second regular connection, [%d] %s\n",
mysqli_connect_errno(), mysqli_connect_error());
- if (!$res = mysqli_query($link2, 'SELECT "works..." as _desc'))
+ if (!$res = mysqli_query($link2, "SELECT 'works...' as _desc"))
printf("[003] Cannot run query, [%d] %s\n",
mysqli_errno($link2), mysqli_error($link2));
$host, $user, $db, $port, $socket,
mysqli_connect_errno(), mysqli_connect_error());
- if (!$res = mysqli_query($plink, 'SELECT "works..." as _desc'))
+ if (!$res = mysqli_query($plink, "SELECT 'works...' as _desc"))
printf("[005] Cannot run query, [%d] %s\n",
mysqli_errno($plink), mysqli_error($plink));
$host, $user, $db, $port, $socket,
mysqli_connect_errno(), mysqli_connect_error());
- if (!$res = mysqli_query($plink2, 'SELECT "works..." as _desc'))
+ if (!$res = mysqli_query($plink2, "SELECT 'works...' as _desc"))
printf("[007] Cannot run query, [%d] %s\n",
mysqli_errno($plink2), mysqli_error($plink2));
$host, $user, $db, $port, $socket,
mysqli_connect_errno(), mysqli_connect_error());
- if (!$res = mysqli_query($plink3, 'SELECT "works..." as _desc'))
+ if (!$res = mysqli_query($plink3, "SELECT 'works...' as _desc"))
printf("[009] Cannot run query, [%d] %s\n",
mysqli_errno($plink2), mysqli_error($plink2));
Persistent connection 1 - 'works...'
Persistent connection 2 - 'works...'
Persistent connection 3 - 'works...'
-done!
\ No newline at end of file
+done!
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s, [%d] %s\n",
$host, $user, $db, $port, $socket, mysqli_connect_errno(), mysqli_connect_error());
}
- if (!mysqli_query($link1, 'SET @pcondisabled = "Connection 1"'))
+ if (!mysqli_query($link1, "SET @pcondisabled = 'Connection 1'"))
printf("[002] Cannot set user variable to check if we got the same persistent connection, [%d] %s\n",
mysqli_errno($link1), mysqli_error($link1));
printf("Connection 2 (no reuse) - Thread ID -> '%s'\n", $thread_id);
mysqli_free_result($res);
- if (!mysqli_query($link2, 'SET @pcondisabled = "Connection 2"'))
+ if (!mysqli_query($link2, "SET @pcondisabled = 'Connection 2'"))
printf("[006] Cannot set user variable to check if we got the same persistent connection, [%d] %s\n",
mysqli_errno($link2), mysqli_error($link2));
Connection 2 - SELECT @pcondisabled -> 'Connection 2'
Connection 2 (reuse) - SELECT @pcondisabled -> 'Connection 2'
Connection 2 (reuse) - Thread ID -> '%d'
-done!
\ No newline at end of file
+done!
'CREATE TABLE IF NOT EXISTS bogus(id INT)',
'SET @a = 1',
'SELECT * FROM test ORDER BY id ASC LIMIT 2',
- 'INSERT INTO test(id, label) VALUES (100, "z")',
+ "INSERT INTO test(id, label) VALUES (100, 'z')",
'SELECT * FROM test ORDER BY id ASC LIMIT 2',
'SELECT',
'UPDATE test SET id = 101 WHERE id > 3',
mysqli_real_query($link, "DROP PROCEDURE IF EXISTS p");
if (mysqli_real_query($link, 'CREATE PROCEDURE p(IN ver_in VARCHAR(25), OUT ver_out VARCHAR(25)) BEGIN SELECT ver_in INTO ver_out; END;')) {
$have_proc = true;
- $queries[] = 'CALL p("myversion", @version)';
+ $queries[] = "CALL p('myversion', @version)";
}
mysqli_close($link);
printf("[018] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_stmt_close($stmt);
- if (!is_object(($stmt = mysqli_prepare($link, 'DO GET_LOCK("testlock", 1)'))))
+ if (!is_object(($stmt = mysqli_prepare($link, "DO GET_LOCK('testlock', 1)"))))
printf("[019] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
mysqli_stmt_close($stmt);
if (false !== ($tmp = mysqli_query($link, 'THIS IS NOT SQL')))
printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
- if (false !== ($tmp = mysqli_query($link, 'SELECT "this is sql but with backslash g"\g')))
+ if (false !== ($tmp = mysqli_query($link, "SELECT 'this is sql but with backslash g'\g")))
printf("[005] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
if ((0 === mysqli_errno($link)) || ('' == mysqli_error($link)))
printf("[006] mysqli_errno()/mysqli_error should return some error\n");
- if (!$res = mysqli_query($link, 'SELECT "this is sql but with semicolon" AS valid ; '))
+ if (!$res = mysqli_query($link, "SELECT 'this is sql but with semicolon' AS valid ; "))
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
var_dump(mysqli_fetch_assoc($res));
mysqli_free_result($res);
- if (!$res = mysqli_query($link, 'SELECT "a" AS ""'))
+ if (!$res = mysqli_query($link, "SELECT 'a' AS ''"))
printf("[007a] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
var_dump($tmp = mysqli_fetch_assoc($res));
var_dump($tmp[""]);
mysqli_free_result($res);
- if (false !== ($res = mysqli_query($link, 'SELECT "this is sql but with semicolon" AS valid ; SHOW VARIABLES')))
+ if (false !== ($res = mysqli_query($link, "SELECT 'this is sql but with semicolon' AS valid ; SHOW VARIABLES")))
printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (mysqli_get_server_version($link) > 50000) {
unicode(1) "a"
Warning: mysqli_query(): Couldn't fetch mysqli in %s on line %d
-done!
\ No newline at end of file
+done!
if (!mysqli_query($link, 'CALL p(@version)'))
printf("[011] Cannot call SP, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- if (!mysqli_query($link, 'SET @version = "unknown"'))
+ if (!mysqli_query($link, "SET @version = 'unknown'"))
printf("[012] Cannot reset user variable, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (!mysqli_query($link, 'CALL p(@version)'))
if (mysqli_real_query($link, 'CREATE PROCEDURE p(IN ver_in VARCHAR(25), OUT ver_out VARCHAR(25)) BEGIN SELECT ver_in INTO ver_out; END;')) {
/* no result set, one input, one output parameter */
- if (!mysqli_query($link, 'CALL p("myversion", @version)'))
+ if (!mysqli_query($link, "CALL p('myversion', @version)"))
printf("[018] Cannot call SP, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- if (!mysqli_query($link, 'SET @version = "unknown"'))
+ if (!mysqli_query($link, "SET @version = 'unknown'"))
printf("[019] Cannot reset user variable, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- if (!mysqli_query($link, 'CALL p("myversion", @version)'))
+ if (!mysqli_query($link, "CALL p('myversion', @version)"))
printf("[020] Cannot call SP, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (!$res = mysqli_query($link, 'SELECT @version as _vers'))
[u"id"]=>
unicode(1) "1"
}
-done!
\ No newline at end of file
+done!
if (false !== ($tmp = mysqli_query($link, 'това не е ескюел')))
printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
- if (false !== ($tmp = mysqli_query($link, 'SELECT "това е ескюел, но със обратна наклонена и g"\g')))
+ if (false !== ($tmp = mysqli_query($link, "SELECT 'това е ескюел, но със обратна наклонена и g'\g")))
printf("[005] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
if ((0 === mysqli_errno($link)) || ('' == mysqli_error($link)))
printf("[006] mysqli_errno()/mysqli_error should return some error\n");
- if (!$res = mysqli_query($link, 'SELECT "това ескюел, но с точка и запетая" AS правилен ; '))
+ if (!$res = mysqli_query($link, "SELECT 'това ескюел, но с точка и запетая' AS правилен ; "))
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
var_dump(mysqli_fetch_assoc($res));
mysqli_free_result($res);
- if (false !== ($res = mysqli_query($link, 'SELECT "това ескюел, но с точка и запетая" AS правилен ; SHOW VARIABLES')))
+ if (false !== ($res = mysqli_query($link, "SELECT 'това ескюел, но с точка и запетая' AS правилен ; SHOW VARIABLES")))
printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (mysqli_get_server_version($link) > 50000) {
if (false !== ($tmp = mysqli_real_query($link, 'THIS IS NOT SQL')))
printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
- if (false !== ($tmp = mysqli_real_query($link, 'SELECT "this is sql but with backslash g"\g')))
+ if (false !== ($tmp = mysqli_real_query($link, "SELECT 'this is sql but with backslash g'\g")))
printf("[005] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
if ((0 === mysqli_errno($link)) || ('' == mysqli_error($link)))
printf("[006] mysqli_errno()/mysqli_error should return some error\n");
- if (!mysqli_real_query($link, 'SELECT "this is sql but with semicolon" AS valid ; '))
+ if (!mysqli_real_query($link, "SELECT 'this is sql but with semicolon' AS valid ; "))
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (!is_object($res = mysqli_use_result($link)))
- printf("[008] Expecting reseult object, got %s/%s [%d] %s\n", gettype($res), $res, mysqli_errno($link), mysqli_error($link));
+ printf("[008] Expecting result object, got %s/%s [%d] %s\n", gettype($res), $res, mysqli_errno($link), mysqli_error($link));
var_dump(mysqli_fetch_assoc($res));
mysqli_free_result($res);
}
Warning: mysqli_real_query(): Couldn't fetch mysqli in %s on line %d
-done!
\ No newline at end of file
+done!
else
mysqli_stmt_close($stmt);
- if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (100, "z")', MYSQLI_USE_RESULT) ||
+ if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (100, 'z')", MYSQLI_USE_RESULT) ||
!mysqli_query($link, 'DELETE FROM test WHERE id > 50', MYSQLI_USE_RESULT))
printf("[033] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
Warning: mysqli_stmt_prepare(): (%d/%d): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
[013] Access denied for user '%s'@'%s' (using password: YES)
[016] Access denied for user '%s'@'%s' (using password: YES)
-done!
\ No newline at end of file
+done!
mysqli_stmt_close($stmt);
$stmt = mysqli_stmt_init($link);
- if (!mysqli_stmt_prepare($stmt, 'INSERT INTO test(id, label) VALUES (1, "a")') ||
+ if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (1, 'a')") ||
!mysqli_stmt_execute($stmt))
printf("[006] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
mysqli_stmt_close($stmt);
$stmt = mysqli_stmt_init($link);
- if (!mysqli_stmt_prepare($stmt, 'INSERT INTO test(id, label) VALUES (100, "z")') ||
+ if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (100, 'z')") ||
!mysqli_stmt_execute($stmt))
printf("[007] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
mysqli_stmt_close($stmt);
$stmt = mysqli_stmt_init($link);
- if (!mysqli_stmt_prepare($stmt, 'INSERT INTO test(id, label) VALUES (100, "z")') ||
+ if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (100, 'z')") ||
!mysqli_stmt_execute($stmt))
// NOTE: the error message varies with the MySQL Server version, dump only the error code!
printf("[009] [%d] (error message varies with the MySQL Server version, check the error code)\n", mysqli_stmt_errno($stmt));
mysqli_stmt_close($stmt);
$stmt = mysqli_stmt_init($link);
- if (!mysqli_stmt_prepare($stmt, 'INSERT INTO test(id, label) VALUES (1, "a") ON DUPLICATE KEY UPDATE id = 4') ||
+ if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (1, 'a') ON DUPLICATE KEY UPDATE id = 4") ||
!mysqli_stmt_execute($stmt))
printf("[011] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
if (mysqli_real_query($link, 'CREATE PROCEDURE p(IN ver_in VARCHAR(25), OUT ver_out VARCHAR(25)) BEGIN SELECT ver_in INTO ver_out; END;')) {
// no result set, one input parameter, output parameter
// yes, I really do not want to bind input values...
- if (!$stmt = mysqli_prepare($link, 'CALL p("myversion", @version)'))
+ if (!$stmt = mysqli_prepare($link, "CALL p('myversion', @version)"))
printf("[029] Cannot prepare CALL, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (!mysqli_stmt_execute($stmt))
print "done!";
?>
--EXPECTF--
-done!
\ No newline at end of file
+done!
if (0 !== ($tmp = mysqli_stmt_field_count($stmt)))
printf("[017] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_stmt_prepare($stmt, 'UPDATE test SET label = "z" WHERE id = 1') ||
+ if (!mysqli_stmt_prepare($stmt, "UPDATE test SET label = 'z' WHERE id = 1") ||
!mysqli_stmt_execute($stmt))
printf("[018] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
Warning: mysqli_stmt_prepare(): Couldn't fetch mysqli_stmt in %s on line %d
Warning: mysqli_stmt_field_count(): Couldn't fetch mysqli_stmt in %s on line %d
-done!
\ No newline at end of file
+done!
if (!mysqli_stmt_bind_param($stmt, "ib", $id, $label))
printf("[008] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
- if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "max_allowed_packet"'))
+ if (!$res = mysqli_query($link, "SHOW VARIABLES LIKE 'max_allowed_packet'"))
printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (!$row = mysqli_fetch_assoc($res))
?>
--EXPECTF--
Warning: mysqli_stmt_send_long_data(): Invalid parameter number in %s on line %d
-done!
\ No newline at end of file
+done!
if (!mysqli_stmt_bind_param($stmt, "ib", $id, $label))
printf("[005] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
- if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "max_allowed_packet"'))
+ if (!$res = mysqli_query($link, "SHOW VARIABLES LIKE 'max_allowed_packet'"))
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
if (!$row = mysqli_fetch_assoc($res))
print "done!";
?>
--EXPECTF--
-done!
\ No newline at end of file
+done!
if (NULL !== ($tmp = @mysqli_stmt_store_result($stmt)))
printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
- if (!mysqli_stmt_prepare($stmt, 'INSERT INTO test(id, label) VALUES (100, "z")') ||
+ if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (100, 'z')") ||
!mysqli_stmt_execute($stmt))
printf("[006] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
print "done!";
?>
--EXPECTF--
-done!
\ No newline at end of file
+done!
exit(1);
}
-if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, "a"), (2, "b"), (3, "c"), (4, "d"), (5, "e"), (6, "f")')) {
+if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'), (6, 'f')")) {
printf("[%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
-?>
\ No newline at end of file
+?>