API16:JDatabaseMySQL/getCollation
From Joomla! Documentation
Description
Assumes database collation in use by sampling one text field in one table
<! removed transcluded page call, red link never existed >
Syntax
getCollation()
Returns
string Collation in use
Defined in
libraries/joomla/database/database/mysql.php
Importing
jimport( 'joomla.database.database.mysql' );
Source Body
public function getCollation ()
{
if ($this->hasUTF()) {
$this->setQuery('SHOW FULL COLUMNS FROM #__content');
$array = $this->loadAssocList();
return $array['4']['Collation'];
} else {
return "N/A (mySQL < 4.1.2)";
}
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples