Skip to content
Permalink
Browse files

Simplifying DboMysql::getCharsetName()

  • Loading branch information...
lorenzo committed Oct 16, 2010
1 parent 21f5707 commit a5f3f95e3a994bba6a286e5cad34627837e86316
Showing with 4 additions and 3 deletions.
  1. +4 −3 cake/libs/model/datasources/dbo/dbo_mysql.php
@@ -394,9 +394,10 @@ public function getVersion() {
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;

0 comments on commit a5f3f95

Please sign in to comment.
You can’t perform that action at this time.