how to replace apostrophe (’) with single quote(')

WOW! after surfing the net I found Pascal Martin's answer very also has a reference to a website with the full answer. How to replace Microsoft-encoded quotes in PHP

I was able to replace right quotation mark with normal quote

  //convert single-byte apostrophes -encoded
function convert_smart_quotes($string) 

    $search = array(chr(145), 

    $replace = array("'", 

    return str_replace($search, $replace, $string); 

Also this answer is much more useful: Converting Microsoft Word special characters with PHP

This seems to be a charset issue. Have you checked if even your editor's charset is set to ISO-8859-1?

Anyway, a workaround could be convert your string to hex and let MySQL convert it again to string. I haven't tested this code, but it should work.

function create_note($page_id,$title,$note,$category,$author_id){
    global $conn,$notes_table,$pages_table,$notification_table;
    $sql = "INSERT INTO $notes_table(page_id,title,content,note_category) VALUES(?,?,UNHEX(?),?)";
    $query = $conn->prepare($sql);