1

How can i store Hindi data in Mysql?

I want to code using zend.

I created 1 table in Mysql, I set collation as utf8_general_ci.

vrushali
  • 59
  • 1
  • 6

2 Answers2

0

You should probably use UTF-16 rather than UTF-8. See: http://forums.mysql.com/read.php?103,86499,86910

Polynomial
  • 27,674
  • 12
  • 80
  • 107
0

As you are coding using ZEND PHP Framework, just before the SQL Query for insert/select add the 2 lines for Setting NAMES & Character Set:

$dbhost = 'xx.xx.xx.xx';
$dbuser = 'xyz';
$dbpass = 'xxxxxx';
$dbname = 'yyyy';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die  ('Error connecting to mysql');


    mysql_select_db($dbname);   
    mysql_query("SET NAMES utf8");
    mysql_query("set characer set utf8");

$result = mysql_query("SELECT * FROM tablename etc...");
  • Dear Vrushali, please post whether the method which i suggested worked perfectly OR it required some changes etc. (I would also like to know the working solution). Thanks – Naheed Akhtar Dec 22 '11 at 09:26