Php 5.4.33 database using in php 5.5 utf error

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 …

I may be wrong but I’m pretty sure Hindi character are not available in UTF-8.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.