Will changing collation affect my database?
I'm trying to track down a bug with some random characters appearing when saving data to our database. So far my travels have indicated that it's a character encoding issue.
I've swapped the collation on the dev to utf8_general_ci
and it doesn't seem to have made a difference to the system, but I'm still unsure as to the full implications of changing collation.
I have been poking around in here, http://dev.mysql.com/doc/refman/5.0/en/charset-charsets.html and it's still not entirely clear.
I've also updated the page with the form on to include a utf-8 <meta />
tag.
The background of the issue is that posting a £
from the form, when it runs through our SQLBuilder class, it's passed through mysql_real_escape_string
(deprecated I know :() and ends up in the database, and subsequently generated config files as £
As I understand it, the collat开发者_Go百科ion is a way for the database to compare characters, but I'm still not totally sure.
Ninja edit Web application, posting an HTML form through a PHP class, into a MySQL DB
I usually do a mysql_query("set names utf8");
immediately after connecting to the database.
精彩评论