本文整理汇总了PHP中MySQLDatabase::connection_charset方法的典型用法代码示例。如果您正苦于以下问题:PHP MySQLDatabase::connection_charset方法的具体用法?PHP MySQLDatabase::connection_charset怎么用?PHP MySQLDatabase::connection_charset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySQLDatabase
的用法示例。
在下文中一共展示了MySQLDatabase::connection_charset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_connection_charset
/**
* Sets the character set for the MySQL database connection.
*
* The character set connection should be set to 'utf8' for SilverStripe version 2.4.0 and
* later.
*
* However, sites created before version 2.4.0 should leave this unset or data that isn't 7-bit
* safe will be corrupted. As such, the installer comes with this set in mysite/_config.php by
* default in versions 2.4.0 and later.
*/
public static function set_connection_charset($charset = 'utf8')
{
self::$connection_charset = $charset;
}