I have make a simple function for security prevent from sql injection and XXS here is my code, any suggestion for this? Is this good enough for security?
function mres($input){
if(get_magic_quotes_gpc()){
$input=stripslashes($input);
}
$input=htmlentities($input, ENT_COMPAT, 'UTF-8');
return mysql_real_escape_string($input);
}