首页 > 开发 > PHP > 正文

PHP 设置MySQL连接字符集的方法

2024-05-04 22:08:07
字体:
来源:转载
供稿:网友
mysql_set_charset()。

这个函数是这样用的:

mysql_set_charset('utf8', $link);
成功返回 TRUE,失败返回 FALSE。

就这么简单。

下面是PHP手册原文
This is the preferred way to change the charset. Using mysql_query() to execute SET NAMES .. is not recommended.
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表