title: Can not search arabic in mysql Quran Database with php
body: <p>I am newbie in web programming so I do apologize if I say something wrong.
  I am writing a simple php script to search in an Arabic mysql DB (Quran database from this website <a href="http://qurandatabase.org/Database.aspx">http://qurandatabase.org/Database.aspx</a> - mysql query file format - Arabic(Original)) but I have a very simple problem, which is what I receive by GET method in my php script is not what I entered to search and something add some unwanted Arabic character  to my searched string.
  my codes and out puts are as follows:
  my html code is:</p>
  
  <pre><code> &lt;!DOCTYPE html&gt;
   &lt;html xmlns="http://www.w3.org/1999/xhtml" lang="ar" xml:lang="ar"&gt;
       &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&gt;
       &lt;body&gt;
           &lt;form action="p.php" method="get" accept-charset="UTF-8"&gt;
               Word Search: &lt;input type="text" name="word"/&gt;
               &lt;input type="submit"/&gt;
           &lt;/form&gt;
       &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>my php code is:</p>
  
  <pre><code>&lt;?php
   header('Content-type: text/html; charset=utf-8');
   $DBServer="localhost";
   $DBUser="root";
   $DBPass="1";
   $DB="Quran";
   $DBTable="Quran";
   //echo "Welcome".$_GET["fname"];
   $Word=$_GET['word'];
   echo $Word;
   echo "&lt;br /&gt;";
   echo "&lt;br /&gt;";
   $con=mysql_connect($DBServer,$DBUser,$DBPass);
   if(!$con)
   {
       die("DB Connection error: ".mysql_error());
   }
   mysql_select_db($DB,$con);
   echo "&lt;br /&gt;\n";
  
   echo "&lt;br /&gt;\n";
   echo "&lt;br /&gt;\n";
   echo "&lt;br /&gt;\n";
   echo "select * from $DBTable where AyahText like '%".$Word."%'";
   echo "&lt;br /&gt;\n";
   $select="select * from $DBTable where AyahText like '%ﻢِﻧَ ﺎﻠْﺠِﻧَّﺓِ ﻭَﺎﻠﻧَّﺎﺳِ%'";
   echo $select;
   echo "&lt;br /&gt;\n";
   echo "&lt;br /&gt;\n";
   $select="select * from $DBTable where AyahText like '%".urldecode($Word)."%'";
   echo $select;
   echo "&lt;br /&gt;";
   $result=mysql_query($select);
   //$result=mysql_query("select * from $DBTable where VerseID=$Word");
   $LastSura=1;
   echo $LastSura;
   echo "&lt;br /&gt;";
   while($row=mysql_fetch_array($result))
   {
       echo "salam";
       echo $row['SuraID']."\t".$row['VerseID']."\t".$row['AyahText'];
       echo "&lt;br /&gt;";
       if($row['SuraID']!=$LastSura)
       {
           echo "&lt;br /&gt;";
           echo "&lt;br /&gt;";
       }
       $LastSura=$row['SuraID'];
  
   }
   mysql_close($con);
   ?&gt;
  </code></pre>
  
  <p>and I enter this string in my html text box:</p>
  
  <blockquote>
    <p>مِنَ الْجِنَّةِ وَالنَّاسِ</p>
  </blockquote>
  
  <p>but I get this string with few difference in output which you have to test it yourself:</p>
  
  <blockquote>
    <p>مِنَ الْجِنَّةِ وَالنَّاسِ</p>
    
    <p>select * from Quran where AyahText like '%مِنَ الْجِنَّةِ وَالنَّاسِ%'</p>
    
    <p>select * from Quran where AyahText like '%مِنَ الْجِنَّةِ وَالنَّاسِ%'</p>
    
    <p>select * from Quran where AyahText like '%مِنَ الْجِنَّةِ وَالنَّاسِ%'
    1</p>
  </blockquote>
  
  <p>and it cause my search to fail . </p>
  
  <p>I don't know if this copy and paste for questioning keeps my correct output to show you correctly or not but in my browser in  الْجِنَّةِ and النَّاسِ up on ن I have unwanted ِ  or َ in my output.
  so much thanks for any help.</p>