UTF8 mysql encoded database field showing only special characters in php page -


i have database field utf8_unicode_ci encoding in mysql. arrangements done previous developer , it's store arabic language data in special character format this:

رنا كلبونه

i have set headers <meta http-equiv="content-type" value="text/html; charset=utf-8" /> not showing arabic language characters when try fetch values database. it's showing these special characters instead of language.

if using mysql use below after db connection

mysql_query("set names utf8");

if using mysqli use below after db connection

mysqli_set_charset($connection,"utf8"); 

if using class , object of mysqli use below

$mysqli = new mysqli("localhost", "root", "", "test"); $mysqli->set_charset("utf8"); 

hope !


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -