请教插入中文到MYSQL,但phpmyadmin却显示空白,该怎么办?
请教插入中文到MYSQL,但phpmyadmin对应字段却显示空白,该怎么办?
回复讨论(解决方案)
在哪插入的?
问题没表述清楚
看看是不是变量名写错了
问题说的不够清楚。可能压根就没插入进去,另外中文的话可能是编码问题,显示不出来。
不好意思,没说清楚。
我是用PHP写的一个方法,执行insert命令
function newreader($name,$pass,$email)
{
// $str="INSERT INTO reader(`name` ,`password`) VALUES (`".$name."`,`".$pass."`)";
$str="insert into reader (name,password,email) values ('".$name."','".$pass."','".$email."')";
// var_dump($str);
try
{
mysql_query($str);
}
catch(Exception $e)
{
var_dump($e);
}
}
不过执行完后到MYSQL里面看,如果插入的name为中文,则数据库里面显示的不是空白,就是问号(?)
数据库字符集用的是:UTF-8 Unicode (utf8)
连接校对选的是:UTF-8_general_ci
我的网页也已经设置:
mysql_query("SET NAMES utf8");
请问该怎么办,如果才能插入中文?谢谢
如果插入英文和数字正常,只是中文不正常的,那就是编码问题,把编码转换下就可以了

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Where does the wordpress database exist?

How to add foreign keys in phpmyadmin

What is the password for the phpmyadmin account?

How to delete data table in phpmyadmin

Where is the associated view of phpmyadmin
