944,181 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 10404
  • PHP RSS
Oct 17th, 2007
0

inserting arabic characters into mysql

Expand Post »
Hello,

I have looked everywhere on the web for a solution to this problem.

I am trying to store arabic characters into mysql via an html form.

i have set the meta charset to utf-8 and have tried mysql_query('set names 'utf=8'")

but still i get garbled characters in my table:

لربيلبي

Please advise!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
roy-- is offline Offline
25 posts
since Sep 2007
Oct 17th, 2007
0

Re: inserting arabic characters into mysql

Reputation Points: 6
Solved Threads: 19
Posting Whiz in Training
fatihpiristine is offline Offline
283 posts
since Sep 2007
Oct 18th, 2007
0

Re: inserting arabic characters into mysql

thanks faith but that didnt help with my problem.

:/
Reputation Points: 10
Solved Threads: 0
Light Poster
roy-- is offline Offline
25 posts
since Sep 2007
Oct 18th, 2007
0

Re: inserting arabic characters into mysql

did you try ansi_unicode_?
Reputation Points: 6
Solved Threads: 19
Posting Whiz in Training
fatihpiristine is offline Offline
283 posts
since Sep 2007
Oct 20th, 2007
0

Re: inserting arabic characters into mysql

i have something like this
i insert data into db
in the db the data is not readable
but when select it on a php page
everything goes well
so the application is running anyway
Reputation Points: 18
Solved Threads: 9
Junior Poster
w_3rabi is offline Offline
160 posts
since Dec 2006
Oct 20th, 2007
0

Re: inserting arabic characters into mysql

is it local or remote located database?
if locale chech my.ini, find default charset and change it to ansi_unicode
collation in the same way.
Reputation Points: 6
Solved Threads: 19
Posting Whiz in Training
fatihpiristine is offline Offline
283 posts
since Sep 2007
Oct 21st, 2007
0

Re: inserting arabic characters into mysql

Got it working!

mysql_query("set names 'utf8'");

Thanks everyone for your replies..
Reputation Points: 10
Solved Threads: 0
Light Poster
roy-- is offline Offline
25 posts
since Sep 2007
Jan 11th, 2010
0
Re: inserting arabic characters into mysql
I Have same problem...
It is solved also when I put
mysql_query(
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Lotus-Sy is offline Offline
1 posts
since Jan 2010
Jan 2nd, 2011
0
Re: inserting arabic characters into mysql
To read ,write and sort Arabic text in mysql database using php correctly, make sure that:

1- MySQL charset: UTF-8 Unicode (utf8)
2- MySQL connection collation: utf8_general_ci
3- your database and table collations are set to: utf8_general_ci or utf8_unicode_ci

Then, add this code in your php script when you connect to db:

mysql_query("SET NAMES 'utf8'");
mysql_query('SET CHARACTER SET utf8');

for more details:
http://www.adviesenzo.nl/examples/ph...l_charset_fix/

I have tested it and it works well, I hope that would be helpful..

thanks!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
almounkez is offline Offline
1 posts
since Feb 2008
Sep 8th, 2011
0
Re: inserting arabic characters into mysql
hey i was have this problem for two days and i have found the solution .. you have to add this code
accept-charset="utf-8"
to your forum
Reputation Points: 10
Solved Threads: 0
Newbie Poster
wafa@ is offline Offline
1 posts
since Sep 2011

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: how to edit/update a variable in a file.
Next Thread in PHP Forum Timeline: Sending PM social website





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC