Modules/MTA-MySQL/mysql get character set info: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ Retreives information about a character set ==Syntax== <syntaxhighlight lang="lua"> string, string, string, string, int, int mysql_get_character_set_info ( MySQLConnection handler, string char...)
 
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<pageclass class="#AA7592" subcaption="MTA-MySQL Module"></pageclass>
__NOTOC__
__NOTOC__
{{ModuleFunction|MTA-MySQL}}
Retreives information about a character set
Retreives information about a character set



Latest revision as of 17:42, 5 January 2011


Package-x-generic.png This function is provided by the external module MTA-MySQL. You must install this module to use this function.

Retreives information about a character set

Syntax

string, string, string, string, int, int mysql_get_character_set_info ( MySQLConnection handler, string character_set_name )

Required arguments

  • handler: A valid MySQL link
  • character_set_name: The character set name

Returns

The character set information:

  • The charset name
  • The charset collation
  • The charset comment
  • The charset directory
  • Multi byte character min. length
  • Multi byte character max. length

Example

Example 1:

local name, collation, comment, directory, mbminlen, mbmaxlen =
      mysql_get_character_set_info(handler, "utf8") -- We will return information about the charset "utf8"

outputDebugString("UTF-8 charset information:\n" ..
                  "name: " .. name .. "\n" ..
                  "collation: " .. collation .. "\n" ..
                  "comment: " .. comment .. "\n" ..
                  "directory: " .. directory .. "\n" ..
                  "mbminlen: " .. mbminlen .. "\n" ..
                  "mbmaxlen: " .. mbmaxlen)

See also