Jump to content


Collation Problem

  • Please log in to reply
3 replies to this topic

#1 Isoss

  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 27 June 2006 - 10:24 AM

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!

#2 Isoss

  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 29 June 2006 - 09:12 AM

Hello!!! Believe me this is a MYSQL problem! ... The thread has been posted for 2 days and only 9 viewrs! ...

#3 Isoss

  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 02 July 2006 - 08:32 AM

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!!

#4 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 03 July 2006 - 05:19 AM

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.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users