I’m trying to store file names in my mariaDB table which are in many different languages. This includes things like french, spanish, Tamil, Amharic etc
When I insert them into the DB they go all screwy. But weirdly if I do a manual insert via phpmyadmin it inserts correctly. The pic below shows the problem on 176 and 173/174 is the manual phpmyadmin.
I am using procedural mysqli but I’ve also tried PDO to see if that changed anything.
I’ve tried changing the collation on the field to different settings, currently on UTF8_general_ci but I’ve tried utf8mb4_unicode_ci and a few others.
My PDO test insert is stripped back to bare essentials so there isn’t anything happening to the variables except for bindParam.
Any ideas what I need to do to get it to work? PHPmyadmin is clearly doing something to allow it to insert correctly, so what are they doing differently to my basic insert queries?
Are you setting the character set, in the php database connection code, to match your database tables, so that no character conversion occurs when data is sent to and retrieved from the database?
Are you setting the character set on the connection?
Normally I would never trust what PHPMyAdmin shows me. Write it to database and read it back and compare it. As long as this is good you do not need to worry