La connessione è attiva il problema a questo punto direi che è dovuto alla mia versione di PHP troppo recente.

Come potrei utilizzare ad oggi questa funzione?

if(!function_exists('Saveseourl')){
function Saveseourl($str) {
$str = trim($str);
$quotes = array('"', "'", ",", ".", "?", "!", ">", "<", "|", "\\", "/", "#", "%", "^", "&", "*", "`", "~", ")", "(", "@");
$str = str_replace($quotes, "", $str);
$str = str_replace(" ", "-", $str);
return mysql_real_escape_string($str);

}
}