Useful MySql Code Snippets

How do i display non English characters to and from mysql database using vanilla PHP?

Put the following after you can created a connection object:

mysqli_query($conn, "SET NAMES 'UTF8'");

Ensure you setup the encoding in the HTML:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
comments powered by Disqus