diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index d3d52726..61b1699a 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -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; } diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 77cfc418..7c880bdf 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -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; }