API15

JDatabaseMySQL/getCollation: Difference between revisions

From Joomla! Documentation

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...
 
m preparing for archive only
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JDatabaseMySQL/getCollation|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JDatabaseMySQL/getCollation}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 35: Line 35:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JDatabaseMySQL/getCollation|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JDatabaseMySQL/getCollation}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=getCollation
  category=getCollation
  category=JDatabaseMySQL
  category=JDatabaseMySQL
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API15]]

Latest revision as of 00:27, 25 March 2017

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