Avihai Posted January 15, 2008 Share Posted January 15, 2008 How can I output this code in utf-8??? As for now I get ??? instead of the real text. The db is set to utf-8 collation (I don't need the whole thing just the encoding fix). $link = mysql_connect('localhost', 'root', ''); mysql_select_db('db', $link); $sql = mysql_query("SELECT * FROM name"); $result = mysql_query($sql, $link); I know that I should use set names but I just can't figure out how. Thanks, Avihai Link to comment https://forums.phpfreaks.com/topic/86221-set-names-and-utf-8/ Share on other sites More sharing options...
p2grace Posted January 15, 2008 Share Posted January 15, 2008 Try this: mysql_query("SET NAMES 'utf8'"); Link to comment https://forums.phpfreaks.com/topic/86221-set-names-and-utf-8/#findComment-440411 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.