I use ASP.NET and use MySqlConnection to run an insert query that has an emoji inside the text:
Hi
Connection string is :
string connectionString = "SERVER=" + Server + ";" + "DATABASE=" + Database + ";" + "UID=" + Uid + ";" + "PASSWORD=" + Password + ";charset=utf8mb4;";
my query is :
query = @"insert into outgoing_message(from_mobile_number, dest_mobile_number, message_body, creation_date, due_date, recID, DCS) values ('" + From + "', '" + item.Mobile + "', N'" + "Hi " + "', now(), now(),'" + item.RecID + "','" + Dcs + "');SELECT LAST_INSERT_ID();";
I get the following error:
Incorrect string value: '\xF0\x9F\x98\x80y' for column `...`.`...`.`message_body` at row 1
But I did all the configurations correctly.