API using
<?php
require_once ("connect.php");
mysqli_query($con, "SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'");
$sql = mysqli_query($con,"SELECT * FROM question order by date desc limit 5");
$rows=array();
while($r=mysqli_fetch_assoc($sql))
{
$rows[]=$r;
}
print json_encode($rows);
?>
when im removing
mysqli_query($con, “SET character_set_results = ‘utf8’, character_set_client = ‘utf8’, character_set_connection = ‘utf8’, character_set_database = ‘utf8’, character_set_server = ‘utf8’”);
then old database running properly its shows in hindi font in website and new inserted database displayig hindi font like this ??? means old datbase hindi font working properly
and when using those lines then
new inserted database working properly and old database displaying like this
महारषà¥à¤Ÿà¥à¤° में बीजेपी और मà¥à¤¸à¥à¤²à¤®à¤¾
pls help …