UTF8, PHP and MySQLThe problemGet a £ character stored to MySQL, retrieved and then displayed without any weird characters in front of it using UTF8. The solutionMake sure that you are using UTF8 everywhere! The browser:<?php header("Content-type: text/html; charset=utf-8"); ?> You can also use a meta tag that is redundant in theory:
Mysql:Make sure that your table's collation is utf8_general_ci and that all string fields within the table also have the utf8_general_ci collation. And here's the really important bit: make sure your client connection is also using UTF-8: For mysql:
or for mysqli:
or execute the SQL immediately after connection:
or for PDO:
or for Zend_Db:
Now everything works as expected! |
Active forum topics
Current jobs
No job postings to display
Who's new
Poll
|










