i want to store urdu word in database and in the database they should store ???????? this value
In yii database connection charset =>'utf8'
table type is utf8_general_ci
using Yii framework php
Asked
Active
Viewed 116 times
0

Bilal Islam
- 39
- 7
-
Have you tried this link http://stackoverflow.com/questions/6859018/save-data-in-arabic-in-mysql-database – Talha Malik Mar 17 '15 at 12:19
2 Answers
0
Your main.config
file should be like this:
'components' => array(
...
'db' => array(
...
'charset' => 'utf8',
'initSQLs'=>'SET NAMES utf8 ;',
),
),

hamed
- 7,939
- 15
- 60
- 114
-
'db' => array( 'connectionString' => 'mysql:host=localhost;dbname=e_promotion', 'emulatePrepare' => true, 'username' => 'root', 'password' => 'root', 'charset' => 'utf8', 'schemaCachingDuration' => 1, ), – Bilal Islam Mar 16 '15 at 09:52
-
-
Follow [this documentation](http://www.yiiframework.com/wiki/16/how-to-set-up-unicode/). Hope this help you. – hamed Mar 16 '15 at 10:06
0
MySQL's 'utf8' is a 3-byte lie. Use utf8mb4
instead for all your settings (both table definitions and connection settings) if you want to correctly handle all UTF-8 characters.

Willem Renzema
- 5,177
- 1
- 17
- 24