Click here to Skip to main content
14,327,288 members
Rate this:
Please Sign up or sign in to vote.
See more:
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 ??
Posted
Updated 13-Sep-19 4:18am
v3

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 2

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
   
Comments
Madhuri Gamane 28-Nov-14 2:12am
   
MySql Dont Has NVARCHAR datatype
syed shanu 28-Nov-14 2:28am
   
HI,
Sorry for that in tag i saw SQl .I dont have Mysql .I check for the solution the below link seems it will work for you try this.


CREATE DATABASE hindi_test
CHARACTER SET utf8
COLLATE utf8_unicode_ci;

USE hindi_test;

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
('कंप्यूटर');

Link :
http://stackoverflow.com/questions/11292898/how-to-insert-hindi-language-in-mysql

http://srinix.wordpress.com/2007/08/29/tutorial-how-to-store-utf8-indian-language-data-in-mysql/
Madhuri Gamane 28-Nov-14 5:24am
   
Thanx but not working

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100