Quantcast
Viewing latest article 3
Browse Latest Browse All 6

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 Image may be NSFW.
Clik here to view.
:D
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;
?>


Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

Viewing latest article 3
Browse Latest Browse All 6

Trending Articles