Actions

API16

JDatabaseMySQL/getCollation

< API16:JDatabaseMySQL

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

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


Advertisement