2

I am a new bee in php/mysql for Hindi Language

1.I need to insert Name in Hindi in mysql Table [st_name] via php.

2.Provide Search on Name field in Hindi Language.

MySql Table

CREATE TABLE `st_name` 
(
  `id` int(11) NOT NULL auto_increment,
  `nameinhindi` varchar(256) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

I am using <meta charset="UTF-8" /> Encoding

What I Have already tried is

Query1. mysql_query('SET character_set_results=utf8');

Query2. mysql_query('SET names=utf8');

Query3. mysql_query('SET character_set_client=utf8');

Query4. mysql_query('SET character_set_connection=utf8');

Query5. mysql_query('SET character_set_results=utf8');

Query6. mysql_query('SET collation_connection=utf8_general_ci');

Query7. mysql_query("INSERT INTO `mahmoodialibrary`.`st_name` (`id` ,`nameinhindi`) VALUES (NULL , 'SomeNameInHindiFromHindiKeyboard');");

Problem 1: from Query 7 values successfully inserted into st_name but when I show it on Php page then i found '?????' string on name field.

Problem 2: Also I have to provide Search on Name Field but dont know How?

I am using collection for table = 'utf8_general_ci'

VIVEK-MDU
  • 2,483
  • 3
  • 36
  • 63

1 Answers1

0

Did you set proper charset in the HTML Head section?

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

and you are using PHP code in page.

  header( 'Content-Type: text/html; charset=utf-8' ); 

and also read this @Owen Answer

you can read this following article How to insert Indian Language in MYSQL

Community
  • 1
  • 1
VIVEK-MDU
  • 2,483
  • 3
  • 36
  • 63