Jump to content


This topic is now archived and is closed to further replies.


Collation Problem

Recommended Posts

I have mysql 5 client and server installed on my ubuntu linux system.

I have just inserted the first chapter of genesis into the database using SQL in phpmyadmin. Data are shown correctly with phpmyadmin, but when I retrieve the data with PHP data appear like ????? in the webpage.
Althought I have set the charset to windows-1256 using this PHP script:
mysql_connect("localhost","root","") or die ("error");
mysql_select_db("ecacsyr") or die ("error");
header('Content-Type: text/html; charset=windows-1256');
header('Content-Language: ar');
<html dir="rtl">
$sql = "select * from `arabicbible`";
$result = mysql_query($sql);
echo "الكتاب المقدس<br><br>سفر التكوين<br><br>الاصحاح الأول<br><br>";
while ($record = mysql_fetch_assoc($result))
    echo "<b>".$record['nid']." ".$record['verse']."</b><br>";
And this is how it displays my data:
[img src=\"http://nourelalam.org/Isos/bible.png\" border=\"0\" alt=\"IPB Image\" /]

As you can see, data appear as ???? while other characters written in HTML they appear in arabic as they should.

So I have set the collation to cp1256_general_ci for the database, the table and the verse field which contains the arabic text.

Have a look at my phpmyadmin:
[img src=\"http://nourelalam.org/Isos/genesis.phpmyadmin.png\" border=\"0\" alt=\"IPB Image\" /]

Please help!

I've never faced any problem with the collations before untill I upgraded to mysql5! before I never had to set any collation or work with anything related to charset in mysql ... phpmyadmin of my web host server doesn't have this problem at all! ... but I don't know why phpmyadmin gives this option on my localhost ... This is bugging me! and the strange thing is that when I removed mysql 5 completely from my system and reinstalled apache2 with the previous version of mysql and php4 and phpmyadmin and the problem remained! I don't really understand the mechanism of these web applications .. I just know php programming! So please somebody help!

Share this post

Link to post
Share on other sites
Hello!!! Believe me this is a MYSQL problem! ... The thread has been posted for 2 days and only 9 viewrs! ...

Share this post

Link to post
Share on other sites
Come on ppl, I don't think such a problem is difficult for phpfreaks!! ... belive me 5 minutes of your precious time can save a lotta ppl suffering from the same problem! cuz I have googled arround and all I found are some ppl addressing the porblem just like me and getting no solution or response!!

Share this post

Link to post
Share on other sites
This probably has do with the mysqli libraries... I've seen others encounter this problem, but to be honest, I don't know enough about PHP to give you a workaround/fix.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.