Gihan Lasita Gihan Lasita - 1 year ago 170
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?


Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download