$userID = $_GET["userID"];
$oyunID = $_GET["oyunID"];
$title = $_GET["title"];
if($userID=="0"){
   header("Location: index.php");
} else {
$control = $db->get_row("select count(*) as counter from favorites where userID = '".$userID." and oyunID = '".$oyunID."'");
if($control->counter == 0){
	$db->query("insert into favorites (id,userID,oyunID) values(null,$userID,$oyunID)");
}
yanlış anlamadıysam çalışması lazım. kolay gelsin.