本帖最后由 flash3d 于 2012-8-24 15:55 编辑
数据库也是UTF8的
自己写个测试程序,写入中文名能成功
但用XCONVERT就不行,具体要做些什么调整,求大侠指点。- <?php
- $con = mysql_connect("192.168.0.115","root","123456");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- mysql_query("SET NAMES UTF8;",$con);
- mysql_select_db("eat_ultrax", $con);
- mysql_query("INSERT INTO eat_ultrax.pre_ucenter_members (uid, username, password, email, myid, myidkey, regip, regdate, lastloginip, lastlogintime, salt, secques) VALUES ( '".rand(1000,100000)."', '旭日".rand(1000,100000)."', 'a8bb0855af9e4d9bff4cf28f6b832ef6', 'xxxx@163.com', '', '', '127.0.0.1', '1104166020', '127', '1175680800', '714cd2', '')");
- mysql_close($con);
- ?>
复制代码 |