我需要修复这个错误。当前 PHP MySQL 库版本 5.1.72,排序规则为 utf8_general_ci
Error inserting into table: notes: Query Failed: INSERT INTO notes (id,date_entered,date_modified,modified_user_id,created_by,name,file_mime_type,filename,parent_type,parent_id,portal_flag,embed_flag,deleted)
VALUES
('caff0041-48a4-218d-c596-566a8b42549b','2015-12-11 08:38:26','2015-12-11 08:38:26','e982b37c-4773-11e3-9be9-00215aeeb772','e982b37c-4773-11e3-9be9-00215aeeb772','OutlookEmoji-😊.png','image/PNG','OutlookEmoji-😊.png','Emails','c1ba0bf7-cb38-701a-270e-566a8b7a23c2',0,0,0): MySQL error 1366: Incorrect string value: '\xF0\x9F\x98\x8A.p...' for column 'name' at row 1
提前致谢。
最佳答案
为您的数据库将数据库排序规则设置为 utf-8
。
您遇到错误是因为您正在插入 OutlookEmoji-😊.png
更改排序规则后,运行查询。
关于php - 如何解决插入到表中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34222629/