Вы находитесь на странице: 1из 2

Save Data in Arabic in MySQL database - Stack Overflow

Page 1 sur 2

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Tell me more

Save Data in Arabic in MySQL database

I have changed the charset of the tables and of the column, i get the arabic text as ???? marks in MYSQL database here is the design of the table CREATE DATABASE mydb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `categories` ( `category_id` tinyint(2) NOT NULL auto_increment, `category_name` varchar(50)character set utf8 NOT NULL , PRIMARY KEY (`category_id`)

insert into `mydb`.`categories` (`category_id`, `category_name`) values (1,';)' commit; When I again fire select query it shows ???? as text? Can anyone tell me where am i doing wrong?
mysql arabic charset-table

edited Aug 2 '11 at 5:54

asked Jul 28 '11 at 12:32 Romani 893 13 20

Which version of mysql? How are you displaying your text? can you give the code you are using to retrieve the data back? I'm using the same encoding and collation and it works fine for me. Sinbadsoft.com Jul 28 '11 at 12:36 Mysql version 5.0.45. using select query.. select * from poll_categories Romani Jul 28 '11 at 12:45 This works for me in MySQL WB gbn Jul 28 '11 at 12:45 It should work. As answers suggest, make sure that you use the correct encoding in the client side. What client are you using here? Sinbadsoft.com Jul 28 '11 at 12:48 client is SQLYog Romani Jul 29 '11 at 4:41

3 Answers
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/php_mysql_charset_fix/
answered Aug 3 '12 at 17:27 user1417996 147 1 12

http://stackoverflow.com/questions/6859018/save-data-in-arabic-in-mysql-database

22/10/2013

Save Data in Arabic in MySQL database - Stack Overflow

Page 2 sur 2

Make sure that your client software is also using UTF-8. http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html
answered Jul 28 '11 at 12:39 sw0x2A 120 5 yes, i have used 'set names utf8' Romani Jul 28 '11 at 12:46

We can convert database or db table to uft8 supportive with below query: ALTER DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE tablename CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE `db_table_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci Hope it helps ! Read More @ https://kb.mediatemple.net/questions/138/Default+MySQL+character+set+and+collation#gs http://hollyslog.com/technology/how-to-store-arabic-or-hebrew-characters-mysql-database
answered Sep 16 at 8:54 Aditya Bhatt 1,606 1 23 45

Not the answer you're looking for? Browse other questions tagged mysql arabic
charset-table or ask your own question.

http://stackoverflow.com/questions/6859018/save-data-in-arabic-in-mysql-database

22/10/2013

Вам также может понравиться