Skip to content

Commit

Permalink
Simplifying DboMysql::getCharsetName()
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Oct 16, 2010
1 parent 21f5707 commit a5f3f95
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cake/libs/model/datasources/dbo/dbo_mysql.php
Expand Up @@ -394,9 +394,10 @@ public function getVersion() {
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;
Expand Down

0 comments on commit a5f3f95

Please sign in to comment.