Possible Duplicate:
UTF-8 all the way through
i want ti have fully unicode database via mysql. i hear about using SET NAMES 'utf8'
is not good for some SQL injection issue.
what's the best usage mysql for fully unicode support.
Possible Duplicate:
UTF-8 all the way through
i want ti have fully unicode database via mysql. i hear about using SET NAMES 'utf8'
is not good for some SQL injection issue.
what's the best usage mysql for fully unicode support.
We often use utf8_general_ci
as table collation in mysql databases. It's faster but it is considered a legacy collation. The mysql documentation recommends utf8_unicode_ci
for most precise character resolution. As for the sql injection: you need to escape with mysql_real_escape_string()
instead of addslashes()
, the latter won't prevent sql injection in unicode tables.