$sql = "SELECT * FROM amigos a WHERE a.id_usuario=17 AND a.id_amigo IN(SELECT b.id_amigo FROM amigo b WHERE b.id_usuario=12)";