mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +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) {
|
||||
if ((bool)version_compare($this->getVersion(), "5", ">=")) {
|
||||
$r = $this->_execute('SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLLATIONS WHERE COLLATION_NAME = ?', array($name));
|
||||
$cols = $r->fetchArray();
|
||||
if (isset($cols['COLLATIONS']['CHARACTER_SET_NAME'])) {
|
||||
return $cols['COLLATIONS']['CHARACTER_SET_NAME'];
|
||||
$cols = $r->fetch();
|
||||
|
||||
if (isset($cols['CHARACTER_SET_NAME'])) {
|
||||
return $cols['CHARACTER_SET_NAME'];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue