PHP function against SQL injection

Very important PHP function to prevent SQL injection attack . When you will pass any content to function CovertToHTMLentities($Content) , it will return result with HTML Character Entity in place of special characters..

function CovertToHTMLentities($Content)
   {
    $Content=str_replace("'", "&#39",$Content);
    $Content=str_replace("=", "&#61",$Content);
    $Content=str_replace("<", "&lt",$Content);
    $Content=str_replace(">", "&gt",$Content);
    $Content=str_replace('"', "&quot"",$Content);
    $Content=str_replace("*", "&ast",$Content);
    $Content=str_replace(";", "##59",$Content);
    return $Content;

   }