Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='

PHP5.2+MYSQL5.1+APACHE2.29+WINDOW2000 IE6,firefor2,firefox3
       PHP网页向MYSQL数据库插入记录时出现如下问题。
 Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '='        ????????????
 解决方法:1.注意PHP网站  charset=UTF-8"
               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                2.数据库连接设置为 utf8编码

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_member = "localhost";
$database_member = "member";
$username_member = "root";
$password_member = "123456";
$member = mysql_pconnect($hostname_member, $username_member, $password_member) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_query("set names gbk");
?>
           请修改为  mysql_query("set names utf8");
           中文问题花去一天时间,请注意php和MYSQL编码发送相同问题。与MYSQL数据库编码无关

          有问题联系steven_roc@126.com

   

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值