title: how to select mysql query with foreign language?
body: <p>Let me show you in simple way</p>
  <pre><code> SELECT * FROM dictionary WHERE malayalam = 'ആകാശം'
  </code></pre>
  <p>this query working fine on phpmysql at the same time it doesn't detect raw while query on .php page</p>
  <p>I am just building a English to Malayalam and Malayalam to English dictionary</p>
  <p>the website is <a href="http://www.chatfitness.com/" rel="nofollow noreferrer">http://www.chatfitness.com/</a></p>
  <p>receiving malayalam word from mysql working fine on the basis of English word.</p>
  <p>unfortunately receiving English word doesn't work properly :(</p>
  <p>I'm using same query for both function
  here is the code searching with English word</p>
  <pre><code>if(isset($_GET['en']))
  {
      $english = $_GET['en'];
      mysql_query (&quot;set character_set_results='utf8'&quot;); 
      $result=mysql_query(&quot;SELECT * FROM en_table WHERE word = '$english' LIMIT 1&quot;); 
      $numrows=mysql_num_rows($result);
  
      if($numrows!=0){
          $row = mysql_fetch_array($result);
          $english_id = $row['en_id'];
          
          //select malayalam id which are matching with english id
          $en_query = mysql_query(&quot;SELECT * FROM dictionary WHERE english = '$english_id'&quot;); 
          //$en_rows = mysql_fetch_array($en_query);
                  
          while($en_rows = mysql_fetch_array($en_query)){
          $en_malayalam = $en_rows['malayalam'];
          mysql_query (&quot;set character_set_results='utf8'&quot;);
              $ml_query=mysql_query(&quot;SELECT * FROM ml_table WHERE ml_id = '$en_malayalam'&quot;);
              while($ml_rows = mysql_fetch_array($ml_query)){
              echo $ml_rows['word'];
              echo &quot;&lt;br /&gt;&quot;;
              }
          
          }
      
      }else{
          echo &quot;&lt;p&gt;നിങ്ങള്‍ അന്വേഷിക്കുന്ന &quot; . $english . &quot; എന്ന പദത്തിന്റെ അര്‍ഥം കണ്ടെത്താനായില്ല.&lt;/p&gt; 
          &lt;p&gt;സാധ്യമെങ്കില്‍, ദയവായി നിഘണ്ടുവില്‍ ചേര്‍ക്കുക.&lt;/p&gt;&quot;;
      }
  </code></pre>
  <p>the same way I'm using searching with Malayalam</p>
  <pre><code>}elseif(isset($_GET['ml'])){
      $malayalam = $_GET['ml'];
      mysql_query (&quot;set character_set_results='utf8'&quot;);
      $results=mysql_query(&quot;SELECT * FROM ml_table WHERE 'word'= '$malayalam' LIMIT 1&quot;); 
      
      $numrow=mysql_num_rows($results);
      echo $numrow ;
  
     //here is the problem $numrow always zero :( 
      if($numrow!=0){
          $row = mysql_fetch_array($results);
          $malayalam_id = $row['ml_id'];
          //echo $malayalam_id ;
          //select malayalam id which are matching with english id
          $ml_query = mysql_query(&quot;SELECT * FROM dictionary WHERE malayalam = '$malayalam_id'&quot;); 
          //$en_rows = mysql_fetch_array($en_query);
                  
          while($ml_rows = mysql_fetch_array($ml_query)){
          $ml_english = $ml_rows['malayalam'];            
              $ml_query=mysql_query(&quot;SELECT * FROM en_table WHERE en_id = '$ml_english'&quot;);
              while($ml_rows = mysql_fetch_array($ml_query)){
              //echo $ml_rows['word'];
              echo &quot;&lt;br /&gt;&quot;;
              }
          }    
      }else{
          echo &quot;We do not have meaning of $malayalam at the moment. &lt;br /&gt; Could you add your word pls&quot;;
      }
  
  
  }else{
      die(&quot;please select search value&quot;);
  }
  </code></pre>
  <p>what ever I search from mysql $numrow=mysql_num_rows($results); numrows always zero :(
  could you help me please for this problem</p>
  <p>I'm stuck here :(
  thanks in advance</p>