4 Replies - 1346 Views - Last Post: 20 July 2011 - 11:33 AM Rate Topic: -----

#1 paser  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 135
  • Joined: 30-May 09

Using Arabic in php/mysql

Posted 19 July 2011 - 01:20 PM

Hey guys! I am setting up a site and would like for it to include arabic both in the pages displayed and some things stored in the database. I did google this, but I keep getting a bunch of different confusing stuff, I know a lot of the devs on here are arab, and was wondering if anyone could point me in the right direction for using arabic in html, php, and mysql, much appreciated to anyone who can, shukran ^^

Is This A Good Question/Topic? 0
  • +

Replies To: Using Arabic in php/mysql

#2 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2993
  • View blog
  • Posts: 10,341
  • Joined: 08-August 08

Re: Using Arabic in php/mysql

Posted 19 July 2011 - 01:55 PM

This seems to be more related to HTML than PHP, but I could be wrong.
See lang attribute:
http://www.w3schools...gs/tag_font.asp
http://webpageworksh...ml_element_font
Was This Post Helpful? 1
  • +
  • -

#3 paser  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 135
  • Joined: 30-May 09

Re: Using Arabic in php/mysql

Posted 19 July 2011 - 02:21 PM

I think partially but not completely, what you linked me too doesn't allow me to use it in php and store it in an mysql database.
Was This Post Helpful? 0
  • +
  • -

#4 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 947
  • View blog
  • Posts: 2,355
  • Joined: 15-February 11

Re: Using Arabic in php/mysql

Posted 19 July 2011 - 02:54 PM

Have a look at this page
http://www.php.net/m...utf8-encode.php
Was This Post Helpful? 1
  • +
  • -

#5 paser  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 135
  • Joined: 30-May 09

Re: Using Arabic in php/mysql

Posted 20 July 2011 - 11:33 AM

Hey guys I finally got it to work, but I have a question that is nagging me, I got it to work fine with php just by using the mb_internal_encoding function, html just needed a header to be sent by the server and a meta tag as back up, for the database I was hold to make my tables utf8_general_ci or something like that, so everything was set but the communication between the db and php, so I was told I could use


		mysql_query("SET NAMES utf8", $this->link);
		mysql_query("SET CHARACTER SET utf8", $this->link);	




or

		mysql_query("SET character_set_results=utf8", $this->link);
		mysql_query("SET character_set_client=utf8", $this->link);
		mysql_query("SET character_set_connection=utf8", $this->link);



and by looking at the mysql documentation it was an either or thing, but it didn't work unless I used both, anyone have any ideas why?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1