newageguy Posted June 22, 2008 Share Posted June 22, 2008 Hi, Encountering some problems when trying to store and display UTF-8 on my website. I can see the data correctly in phpMyAdmin but when I try to display on my website, the data became ????. Am wondering what is wrong with my codes or settings. I am hosting my website with hostgator and changing my.cnf seems impossible ( i maybe wrong ). mysql_connect( DB_HOST, DB_USER, DB_PASS ); @mysql_select_db( DB_NAME ) or die( "Unable to select database"); mysql_query("SET NAMES 'utf8'"); $query = "SQL Select here"; $return = undef; $result = mysql_query($query); if ($info = @mysql_fetch_array( $result )) { $return = $info; } @mysql_free_result ( $result ); mysql_close(); return $return; Note when I try to print the mysql_client_encoding(), the result is latin1. Do let me know if i need to attach any more results here. Any help is greatly appreciated!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.