API15

API15:JDatabaseMySQL/getCollation

From Joomla! Documentation

Revision as of 22:15, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Assumes database collation in use by sampling one text field in one table <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JDatabase...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Assumes database collation in use by sampling one text field in one table

[Edit Descripton]

Template:Description:JDatabaseMySQL/getCollation

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)";
        }
}

[Edit See Also] Template:SeeAlso:JDatabaseMySQL/getCollation

Examples

<CodeExamplesForm />