Fetching contents with single quote from wordpress mysql DB not showing properly

I have a custom build page in which I have fetched post title and post content from my WordPress blog site. In the site it is showing fine but in the custom php page the special characters (') is printing garbage.

This is how i have written the php block

Read More
$get_post_sql = mysqli_query($con, "SELECT * FROM nn_posts WHERE post_status='publish' and post_type = 'post' ORDER BY ID desc LIMIT 15");
     while($post_list = mysqli_fetch_assoc($get_post_sql)){
         echo $post_list['post_name']."<br>";
     }

How can i print it perfectly?

Related posts