How to Insert bangla in php Mysql database.

if you know how to insert data in English language to mysql database, then It is very easy for you to insert bangla in phpmysql batabase , just you must have write two line extra code in php. for example

<body>
<?php
$con=mysql_connect(“localhost”,”root”);
if(!$con)
die(‘could not connect:’. mysql_error());
mysql_select_db(‘bangla’,$con);

mysql_query(‘SET CHARACTER SET utf8’,$con);                                                     //Extra for Bangla
mysql_query(“SET SESSION collation_connection=’utf8_general_ci'”,$con) ;       // Extra for Bangla

$sql=”INSERT INTO info1 VALUES (‘$_POST[roll]’,’$_POST[name]’,’$_POST[dept]’)”;
if(mysql_query($sql,$con))
echo “One row created”;
else
echo “Error creating row”.mysql_error();
mysql_close($con);
include “shamim.php”;

?>
</body>

I have marked two extra line code using Italic which is needed for bangla input. I hope if you follow this instruction then it will be very easy for you.

N.B: first you need to installed AVRO Unicode and Avro keyboard

Advertisements
  1. Hello Samim Ahmed
    You have done a great job. I think you will be successful to gain your final achievement. Congratulation

    Regards
    Saidur Rahman
    http://ranawd.wordpress.com/

  2. Nice post.. But better solution may be use of MySQL collation in Bangla.
    MySQL server should now have two new collation rules for Bangla:

    1. utf8_bangla_ci : follows the original order
    2. utf8_bangla_dictionary_ci : follows the Bangla Academy dictionary order

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: