Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysqli update bug #229

Closed
dayrui opened this issue Aug 12, 2016 · 2 comments
Closed

mysqli update bug #229

dayrui opened this issue Aug 12, 2016 · 2 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Milestone

Comments

@dayrui
Copy link

dayrui commented Aug 12, 2016

`
$array = '{"\u56fe\u4e66\u7cfb\u7edf"}';

$this->db->table('aaa')->where('id', 1)->update(['array' => $array]);
`
The result in the database is {"u56feu4e66u7cfbu7edf"}

@lonnieezell lonnieezell added the bug Verified issues on the current code behavior or pull requests that will fix them label Aug 16, 2016
@lonnieezell lonnieezell added this to the Pre-Alpha 2 milestone Aug 16, 2016
@lonnieezell
Copy link
Member

We're venturing into areas that aren't my strength here, but I don't believe this is a bug. If looks like you're inserting 4 unicode characters into the database, but the encoding on the database doesn't recognize it so when mysqli_real_escape_string processes it, it removes the slash as it normally would.

The solution, if I'm right, is to change the database to use utf8 encoding. If that doesn't work try utf8mb4 (which is necessary if you're doing things like emoticons).

@InsiteFX
Copy link
Contributor

I researched this a while back and every thing needs to be DEFAULT CHARSET utf8 for the COLLATION it needs to be utf8_general_ci or for better encoding utf8_unicode_ci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

3 participants