I was recently given the task to migrate an old website from latin1 to utf8 and got into some trouble. I managed to alter the database, tables, columns correctly(I think), but the only time that the special characters are not shown on the website as '??' is when I before every query run this query mysql_query("SET NAMES 'UTF8'")
, then all of the data from the database is printed out correctly, if this query does not exist, all hell breaks lose. The default MariaDB server charset is latin1, can this be the issue? If so how will changing the server charset to utf8 impact other older tables and so on. Perhaps I altered my database incorrectly. I am asking for advice, because I believe that running mysql_query("SET NAMES 'UTF8'")
can be slowing down our websites response time. Perhaps there are other issues. We are using php5.6(migration from older version)
I know that mysql_query
is an outdated function and should never be used, but my task was migrating, not messing with the code.
Thanks for the help.