I have saved Telugu language content in the database with utf8mb4_unicode_ci collation, and I am trying to extract that information from a different place (Not WordPress environment) everything ok but Telugu characters are showing as question marks.
this is the content stored in the database. ఆ ఒక్క మాట తో కంపెనీ సర్వ నాశనం | #OURMINE | #VEVO This is the text i am getting. ? ???? ??? ?? ?????? ???? ????? | #OurMine | #Vevo
Code i used to get the information.
<?php
$con=mysqli_connect("localhost","db","pw","db");
mysqli_set_charset('utf8', $con);
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
error_reporting(E_ALL ^ E_NOTICE);
$query = "SELECT * FROM TT_posts WHERE post_status='publish' AND ping_status='open'";
mysqli_set_charset('utf8', $query);
$result = $con->query($query);
while ($row = $result->fetch_assoc()) {
?>
<?php
$image = "SELECT * FROM TT_posts WHERE post_parent='$row[ID]' AND
post_title='FEATURED' AND post_type='attachment'";
$result1 = $con->query($image);
while ($row1 = $result1->fetch_assoc())
$img = $row1[guid];
?>
<div class="featured-thumbnail"><?php echo '<img src="'.$img.'">';?></div>
<header>
<h3 class="featured-category-title"><?php echo $row[post_title];?></h3>
</header>
<?php } ?>
I don't know where i am wrong.