2

I need to fix this error. Current PHP MySQL library version 5.1.72 and collation is 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

Thanks in advance.

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
techies
  • 181
  • 2
  • 13

3 Answers3

0

Make database collation as utf-8 for your database.

You are getting error because, you are inserting OutlookEmoji-.png

After changing the collation, run the query.

Niranjan N Raju
  • 12,047
  • 4
  • 22
  • 41
0

it looks like you trying to insert an invalid character in the field name: OutlookEmoji-.png

  • Ya but I cant fix, Now the database not connecting through this error in log. – techies Dec 11 '15 at 11:41
  • Hi, welcome to stack overflow. When you post an answer you should also indicate a possible solution or you can state explicitly that there is no possible solution, read also this: http://stackoverflow.com/help/how-to-answer – terence hill Dec 11 '15 at 11:54
0

This may answer your question. Namely,

If you have MySQL 5.5 or later you can change the column encoding from utf8 to utf8mb4. This encoding allows storage of characters that occupy 4 bytes in UTF-8.

However you have 5.1,

Although your collation is set to utf8_general_ci, I suspect that the character encoding of the database, table or even column may be different. They are independent settings.

Community
  • 1
  • 1
Satbir Kira
  • 792
  • 6
  • 21
  • I need to fix this error at this time, Any solutions to (OutlookEmoji-.png) remove or change it? – techies Dec 11 '15 at 12:01
  • If the note you are inserting is not important then worry about it later. But make a log of all the notes you didn't insert. Then when you have time either upgrade mysql or try one of those answers. – Satbir Kira Dec 11 '15 at 12:10