`SET NAMES utf8` shouldn't be used from PHP. Set the correct connection charset using the API methods provided, e.g. `mysqli::set_charset()`
– DharmanJun 24 '22 at 13:22
omg!! A small dash sign had delayed me for hours. i use `SET NAMES utf-8` And the problem was solved
– Aref SolaimanyJun 24 '22 at 13:28
I sincerely doubt it, because that's not a valid syntax. Anyway, you must remove `SET NAMES` completely from your code.
– DharmanJun 24 '22 at 13:31
1
See "Mojibake" in https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored
– Rick JamesJun 24 '22 at 15:07