0){ $stmt = $pdodb->prepare("SELECT ID,fname,aboutme,approved,mainpic,emailis, password,username,country,views FROM girls WHERE ID=:sessid"); $stmt->bindParam(':sessid',$_REQUEST["toid"]); $stmt->execute(); while($i3=$stmt->fetch()) { $tname2 = $i3["fname"]; $pid = $i3["ID"]; $aboutme = $i3["aboutme"]; $dapproved = $i3["approved"]; $dmainpic = $i3["mainpic"]; $emailis = $i3["emailis"]; $username = $i3["username"]; $password = $i3["password"]; $country = $i3["country"]; $views = $i3["views"]; } if($_REQUEST["toid"] <> ""){ $stmt = $pdodb->prepare("SELECT ID FROM favorites WHERE fromid=:fromid AND toid=:toid"); $stmt->bindParam(':fromid',$_SESSION["uid"]); $stmt->bindParam(':toid',$_REQUEST["toid"]); $stmt->execute(); if($stmt->rowCount() == 0){ $stmt = $pdodb->prepare("INSERT INTO favorites(fromid,toid) VALUES(:fromid,:toid)"); $stmt->bindParam(':fromid',$_SESSION["uid"]); $stmt->bindParam(':toid',$_REQUEST["toid"]); $stmt->execute(); echo 'anadido!!'; $betreff = ''.$tname.' te ha anadido como favorito'; $message2 = ' '.$tname.' te ha anadido como favorito http://www.concursomodelos.com/'.str_Replace(" ","-",$tname).' nombre usario: '.$username.' '; if(strstr($emailis,"@")){ sendmail('', $emailis, $betreff, $message2); } $stmt = $pdodb->prepare("UPDATE LOW_PRIORITY girls SET tfav=tfav+1 WHERE ID=:sessid"); $stmt->bindParam(':sessid',$_REQUEST["toid"]); $stmt->execute(); }else{ echo 'ya esta en tu lista de amigos '; } } }else{ echo 'registrate para anadir favoritos'; } ?>  Amigos