Replacing mysql_real_escape_string with mysqli_real_escape_string to avoid breakage on PHP 5.5