1) Databas:Ändra databasens standardsortering som utf8mb4
.
2) Tabell:Ändra tabellsortering som CHARACTER SET utf8mb4 COLLATE utf8mb4_bin
.
Fråga:
ALTER TABLE Tablename CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin
3) Kod:
INSERT INTO tablename (column1, column2, column3, column4, column5, column6, column7)
VALUES ('273', '3', 'Hdhdhdh😜😀😊😃hzhzhzzhjzj 我爱你 ❌', 49, 1, '2016-09-13 08:02:29', '2016-09-13 08:02:29')
4) Ställ in utf8mb4
i databasanslutning:
$database_connection = new mysqli($server, $user, $password, $database_name);
$database_connection->set_charset('utf8mb4');