Skip to content
Permalink
Browse files

Using the PDO conenction inside DboMysql::getCharsetName()

  • Loading branch information...
lorenzo committed Oct 15, 2010
1 parent dc362d1 commit 52023085f4ba830954f92840dd38a6c949459d0c
Showing with 6 additions and 5 deletions.
  1. +6 −5 cake/libs/model/datasources/dbo/dbo_mysql.php
@@ -815,11 +815,12 @@ public function getVersion() {
* @param string $name Collation name
* @return string Character set name
*/
function getCharsetName($name) {
if ((bool)version_compare(mysql_get_server_info($this->connection), "5", ">=")) {
$cols = $this->query('SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLLATIONS WHERE COLLATION_NAME= ' . $this->value($name) . ';');
if (isset($cols[0]['COLLATIONS']['CHARACTER_SET_NAME'])) {
return $cols[0]['COLLATIONS']['CHARACTER_SET_NAME'];
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'];
}
}
return false;

0 comments on commit 5202308

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