1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-09 08:06:59 +02:00

Use $connection->result

This commit is contained in:
Jakub Vrana
2025-02-23 14:27:57 +01:00
parent 7f883b9302
commit 5c8b6a3408
2 changed files with 8 additions and 7 deletions

View File

@@ -1066,14 +1066,15 @@ if (!defined("DRIVER")) {
return get_key_vals("SHOW VARIABLES");
}
/** Checks if C-style escapes are supported
/** Check if C-style escapes are supported
* @return bool
*/
function is_c_style_escapes() {
static $c_style = null;
global $connection;
static $c_style;
if ($c_style === null) {
$variables = get_key_vals("SHOW VARIABLES LIKE 'sql_mode'");
$c_style = strpos($variables["sql_mode"], 'NO_BACKSLASH_ESCAPES') === false;
$sql_mode = $connection->result("SHOW VARIABLES LIKE 'sql_mode'", 1);
$c_style = (strpos($sql_mode, 'NO_BACKSLASH_ESCAPES') === false);
}
return $c_style;
}

View File

@@ -888,10 +888,10 @@ AND typelem = 0"
}
function is_c_style_escapes() {
static $c_style = null;
global $connection;
static $c_style;
if ($c_style === null) {
$vals = get_vals("SHOW standard_conforming_strings");
$c_style = $vals[0] == "off";
$c_style = ($connection->result("SHOW standard_conforming_strings") == "off");
}
return $c_style;
}