title: How to fetch from MySQL database “Hindi” (Indian local language) हिन्दी text in websites
body: <p><strong>How to fetch from MySQL database “Hindi” (Indian local language) हिन्दी text in websites</strong></p>
  
  <p><a href="http://i.stack.imgur.com/2Udjw.png" rel="nofollow">pictureofdatabase</a></p>
  
  <p>when i fetch data from database it show </p>
  
  <pre><code>???????????????????????????????????????
  ????????????????????????
  ??????????????????????????????????????
  ??????????????????????????????????????
  </code></pre>
  
  <p><strong>Referring to this question I have changed my database charset to "utf8_unicode_ci", but Still not working. I have written following code to fetch the data</strong></p>
  
  <p>connection.php page </p>
  
  <pre><code>&lt;?php
  
      $DB_HOST = 'localhost';
      $DB_USER = 'xxxxxxxx_usr';
      $DB_PASS = 'xxxxxxxxxxxxxxxxx';
      $DB_NAME = 'xxxxxxxs_dta';
  
      try{
          $DB_con = new PDO("mysql:host={$DB_HOST};dbname={$DB_NAME}",$DB_USER,$DB_PASS);
          $DB_con-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      }
      catch(PDOException $e){
          echo $e-&gt;getMessage();
      }
  </code></pre>
  
  <p>index.php page</p>
  
  <pre><code>&lt;?php include("../header.php"); ?&gt;&lt;style&gt;
      .wrapper{position:relative;}
      .right,.left{width:50%; position:absolute;}
      .right{right:0;}
      .left{left:0;}
  &lt;/style&gt;    &lt;?php
  
      require_once 'connect.php';?&gt;
  &lt;link href='/Lang/style.css' rel='stylesheet' type='text/css'&gt;
  &lt;?php 
  
   $iddd =$_GET['id'];
  $d = $browser_t; ?&gt;
  
  &lt;div class="content"&gt;
  &lt;div class="dta"&gt;   
      &lt;?php
       mysqi_set_charset( $DB_con, 'utf8');
      $stmt = $DB_con-&gt;prepare('SELECT id, title, post, viewers, author, external FROM getpost  WHERE id =:vid');
  
        $stmt-&gt;execute(array(':vid'=&gt;$iddd));
      $stmt-&gt;execute();
  
      if($stmt-&gt;rowCount() &gt; 0)
      {
          while($row=$stmt-&gt;fetch(PDO::FETCH_ASSOC))
          {
              extract($row);
              ?&gt;
  
      &lt;div class="list_item"&gt;&lt;h2&gt;&lt;?php echo $row['title']; ?&gt; Tutorials&lt;/h2&gt;&lt;/div&gt;
  
  &lt;div class="nykfont"&gt; &lt;/div&gt;
  &lt;?php echo $row['post']; ?&gt;
  
  &lt;div class="content"&gt;
  &lt;div class="dta"&gt;   
  &lt;div class="nykfont"&gt; 
      &lt;div class="lis_ite"&gt;&lt;?php echo $row['external']; ?&gt;&lt;/div&gt;
  
      &lt;div class="listt_itemm"&gt;Author&lt;h5&gt;&lt;a href="http://www.mrtutorials.net/Author/&lt;?php echo $row['author']; ?&gt;"&gt;&lt;?php echo $row['author']; ?&gt;&lt;/a&gt;&lt;/h5&gt;&lt;/div&gt;&lt;/div&gt;
          &lt;?php
          }
      }
      else
  
          ?&gt;
  
  &lt;/div&gt;&lt;/div&gt;
  &lt;hr&gt;
  
      &lt;?php include("../footer.php"); ?&gt;  
  </code></pre>