I have an issue where i am trying to write 'Hindi/Chinese' string to MySQL database. PHP is converting that to '????' and that is what i can see in mysql. To isolate issue when i directly put that string in mysql it writes it correctly. does anybody have any idea how i ca resolve this issue.
(my database and tables are in UTF8, PHP configuration set to UTF8)
for every connection to mysql i use set name and set character etc to UTF8
before interacting with mysql, send this two querys:
SET NAMES 'utf8';
CHARSET 'utf8';
When people dont know answer they will not accept the fact but start -ve voting or saying possible duplicate.. without understanding the problem.. which is not good..have great day...
Solution :- i was using below queries after connection.
SET NAMES 'utf8'
SET CHARACTER SET 'utf8'
which was causing issue somehow i am not able to understand why?? but if i remove SET CHARACTER SET 'utf8' and only keep SET NAMES 'utf8' everything works fine.
Thank you everyone for your help, for those to who said it is possible duplicate and -ve voted.