如何在mysql中插入和获取阿拉伯文本 [英] how to insert and fetch Arabic text in mysql
本文介绍了如何在mysql中插入和获取阿拉伯文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从MySQL插入并获取阿拉伯语(或Unicode)数据
,
这是我要插入的代码。
I want to insert and fetch "Arabic" (or Unicode) data from MySQL
,
this is my code to insert.
CREATE TABLE `hindi` (
`data` varchar(200) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `hindi` (`data`) VALUES
(بريا)
但是当我选择它时会显示问号( ???????)
,我将如何获得该语言的文字?
我错过了什么?
but when i select it shows question marks(???????)
,how will i get the text in that language ??
am i missing anything ??
推荐答案
HI,
试试这个查询。这个工作
Try this query.This works
-- You can use Nvarchar
CREATE TABLE hindi (
data NVARCHAR(100) NOT NULL
)
-- before your insert values use"N" as below
INSERT INTO hindi (data) VALUES
(N'بريا')
select * from hindi
这篇关于如何在mysql中插入和获取阿拉伯文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文