Q:

Emojis replaced by question marks when insert in Database

I'm having an issue with emojis not being transferred correctly to my staging site. Some emojis are replaced by a question mark, some don't. It's mainly affecting the blog posts. I'm not sure what is causing this and was hoping someone could point me in the right direction to solving this problem! Could it be something with the character encoding in the database?
For example:
These work: ☀️ ☔️❤️✨
These get replaced by a question mark: 
and show this Error:
1366 Incorrect string value: '\xF0\x9F\x98\x83\xF0\x9F...' for column 'text' at row 1

MY SQL Code:
CREATE TABLE `posts` (
  `id` int(11) UNSIGNED NOT NULL,
  `user_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `text` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `timestamp` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Have run and tried this SQL Codes:
ALTER TABLE posts CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin

ALTER DATABASE test CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

A:

The table definition is correct.
Where are you trying to insert from? Make sure the connection is using utf8mb4-charset. From command line use the --default-character-set=utf8mb4 option.
See db-fiddle

