Isoss Posted June 27, 2006 Share Posted June 27, 2006 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:[code]<?phpmysql_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"><head></head><body><?php$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>";}?></body></html>[/code]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! Quote Link to comment Share on other sites More sharing options...
Isoss Posted June 29, 2006 Author Share Posted June 29, 2006 Hello!!! Believe me this is a MYSQL problem! ... The thread has been posted for 2 days and only 9 viewrs! ... Quote Link to comment Share on other sites More sharing options...
Isoss Posted July 2, 2006 Author Share Posted July 2, 2006 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!! Quote Link to comment Share on other sites More sharing options...
fenway Posted July 3, 2006 Share Posted July 3, 2006 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.