HOME BLOG PORTFOLIO PHOTO CONTACT Admin Login
Mysql insert query error on emoji smily

 Error : I can't able to insert Emoji or smily in mysql

 
$description = "This is a description with some emojis: 😃😄"; 
 
Eroor was coming as this--
 
The error message "Incorrect string value: 'xF0x9Fx98x8A w...' for column 'description' at row 1" indicates that the value you're trying to insert into the description column contains characters that are not supported by the character set used by your MySQL database.
 
 
 
Check the Character Set:
 
SHOW TABLE STATUS FROM your_database LIKE 'your_table';
 
 
    SHOW TABLE STATUS FROM bharatbaba LIKE 'blog_jay';
|Name    |Engine|Version|Row_format|Rows|Avg_row_length|Data_length|Max_data_length|Index_length|Data_free|Auto_increment|Create_time        |Update_time        |Check_time|Collation        |Checksum|Create_options|Comment|
|--------|------|-------|----------|----|--------------|-----------|---------------|------------|---------|--------------|-------------------|-------------------|----------|-----------------|--------|--------------|-------|
|blog_jay|InnoDB|10     |Dynamic   |9   |1,820         |16,384     |0              |0           |0        |10            |2024-07-26 09:06:12|2024-08-30 09:04:57|          |latin1_swedish_ci|        |              |       |
 
 
ALTER TABLE blog_jay CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  ALTER TABLE blog CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
 
   Share on Facebook

Page views:539