mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 19:38:26 +00:00
Simplifying DboMysql::getCharsetName()
This commit is contained in:
parent
21f5707be7
commit
a5f3f95e3a
1 changed files with 4 additions and 3 deletions
|
@ -394,9 +394,10 @@ class DboMysql extends DboSource {
|
||||||
public function getCharsetName($name) {
|
public function getCharsetName($name) {
|
||||||
if ((bool)version_compare($this->getVersion(), "5", ">=")) {
|
if ((bool)version_compare($this->getVersion(), "5", ">=")) {
|
||||||
$r = $this->_execute('SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLLATIONS WHERE COLLATION_NAME = ?', array($name));
|
$r = $this->_execute('SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLLATIONS WHERE COLLATION_NAME = ?', array($name));
|
||||||
$cols = $r->fetchArray();
|
$cols = $r->fetch();
|
||||||
if (isset($cols['COLLATIONS']['CHARACTER_SET_NAME'])) {
|
|
||||||
return $cols['COLLATIONS']['CHARACTER_SET_NAME'];
|
if (isset($cols['CHARACTER_SET_NAME'])) {
|
||||||
|
return $cols['CHARACTER_SET_NAME'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue