Skip to content
May 20, 2008 / ranacse05

Bangla Web App


Last day one of my friend came to me.He was facing a problem (he solved later).Here is his problem —
The Bangla/Unicode data become ?????? in his page.

I’m gonna tell u today step-by-step what u need to do if u wanna develop Bangla/Unicode based Web App.

#1 . First make the database with CHARACTER utf8 and collation_connection =’utf8_general_ci’
#2 . Make the Tables with same configuration.
#3 . When u connect the database use following 2 lines just below the mysql_select_db()

mysql_query(‘SET CHARACTER SET utf8’);
mysql_query(“SET SESSION collation_connection =’utf8_general_ci'”);

#4 . Set the META-TAG as “Content-Type: text/html; charset=UTF-8”

Thats it 😀 u r done.Here is a sample page what will show data from database

<?
header(‘Content-Type: text/html; charset=UTF-8’); //As its php page i dont need the meta-tag so i need to send a header .

mysql_connect(‘localhost’,’xxxxx’,’xxxxxx’) or die(‘Error In connection’);
mysql_select_db(‘test’) or die(‘Error In connection(DB)’);

mysql_query(‘SET CHARACTER SET utf8’);
mysql_query(“SET SESSION collation_connection =’utf8_general_ci'”);

$re = mysql_query(“SELECT * FROM test”) or die(‘Query Problem’);
while($row = @mysql_fetch_assoc($re))
echo $row[‘name’].PHP_EOL;
?>

Advertisements

6 Comments

Leave a Comment
  1. saeed ahmed / May 20 2008 6:09 pm

    nice rana.

    macromedia te html page a kivbe bangla show korbe ata nie akta post kor plz.

  2. Shaiun / May 20 2008 6:31 pm

    Great!! helpful for my self project….

  3. hasin / May 23 2008 6:02 pm

    Nice article Rana, Kudos

  4. unnikuttan / May 23 2008 7:14 pm

    Thanks for the great work with programming codes.

  5. tb / May 26 2008 9:54 pm

    techbangla.net e apnake amontron.

  6. saiful103a / Jul 5 2009 5:01 am

    Wow,i’ve reached here lately but this article is really going to help me.

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: