API15:JDatabaseMySQL/getCollation
From Joomla! Documentation
Description
Assumes database collation in use by sampling one text field in one table
[<! removed edit link to red link >]
<! 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
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 edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples