如何在mysql表中插入汉字? [英] How to insert chinese character in mysql table?

查看:210
本文介绍了如何在mysql表中插入汉字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在mysql表中保存中文数据。



任何人都可以告诉我在mysql和PHP中要做什么设置。 >

我的表将以英文和中文一些列英文中文保存数据。



任何帮助将不胜感激。

解决方案

在创建表时使用UTF-8



create table xxx()CHARACTER SET = utf8; / p>

在插入表格时使用UTF-8



set names utf8;插入到xxx(xx,x);


I want to save data in Chinese language in mysql table.

Can anyone tell me what settings I have to do for it in mysql and PHP.

My table will save data in both English and Chinese some column English other Chinese . Is it possible with single table.

Any help will be appreciated.

解决方案

Use UTF-8 when you create table

create table xxx ()CHARACTER SET = utf8;

Use UTF-8 when you insert to table

set names utf8; insert into xxx (xx,x);

这篇关于如何在mysql表中插入汉字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆