1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

unicode with mysql problem

Discussion in 'PHP' started by arctushar, Sep 8, 2011.

  1. #1
    I have great problem regarding mysql

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    .bangla {
    	font:Solaimanlipi;
    }
    </style>
    </head>
    
    <body>
    <?php
    $con = mysql_connect("localhost","root","password");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    mysql_select_db("quran", $con);
    
    $result = mysql_query("SELECT * FROM `quran` LIMIT 0, 30");
    
    echo "<table border='1' class='bangla'>
    <tr>
    <th>ক্রম</th>
    <th>নাম</th>
    <th>আয়াত সংখ্যা</th>
    </tr>";
    
    while($row = mysql_fetch_array($result))
      {
      echo "<tr>";
      echo "<td>" . $row['serial'] . "</td>";
      echo "<td>" . $row['name'] . "</td>";
      echo "<td>" . $row['ayat'] . "</td>";
      echo "</tr>";
      }
    echo "</table>";
    
    mysql_close($con);
    ?> 
    সূরা  আল্ ফাতিহা
    </body>
    </html>
    Code (markup):
    in the page last line is in bengali. It is showing ok.
    but in the table 1st & 3rd column is ok as they are in english and 2nd column showing "????????" as they are in bengali.
    I set collation of the mysql table to utf8_bin. In the phpmyadmin page table is absolutely ok. it is showing my bengali characters. but in the above coded page 2nd column showing what symbol instead of bengali character.
    What may be the problem. plz help me.
     
    arctushar, Sep 8, 2011 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    Rukbat, Sep 8, 2011 IP
  3. arctushar

    arctushar Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thank you. This had helped me lot.
     
    arctushar, Sep 9, 2011 IP