开发者

Everything is in utf8, but text isn't recording correctly to db anyway

开发者 https://www.devze.com 2023-04-13 02:22 出处:网络
I\'ve created a database (with utf8 charset) and a table with the same charset, all the rows are utf8, in webpage I have meta tag for utf8... Bu开发者_运维问答t anyway, when I type in my forms smth no

I've created a database (with utf8 charset) and a table with the same charset, all the rows are utf8, in webpage I have meta tag for utf8... Bu开发者_运维问答t anyway, when I type in my forms smth not in latin alphabet, it registers in db wth eg. фывфыРHave I missed something?


Try use such code after connecting to DataBase, but befor you recieve/write data

$db->query('set character_set_client=utf8');
$db->query('set character_set_connection=utf8');
$db->query('set character_set_results=utf8');
$db->query('set character_set_server=utf8');
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号