Gihan Lasita Gihan Lasita - 4 months ago 38
PHP Question

how to insert unicode data into table with codeigniter?

My database config file is set to

$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';


but every time i insert Unicode Characters, they are insert as ????? question marks.

my mysql database info as

Type : MyISAM
Collation : latin1_swedish_ci


any idea what im doing wrong and how to fix the issue?

Regards

Answer

the problem mostly with your database collation, you must make it utf-8 since your

$db['default']['dbcollat'] = 'utf8_general_ci';

is not the same as your database collation.