I have a problem. The IP doesn't appears in the other table (in the same db).
In the page "recette1.php?id=1"
<?php
$bdd = new PDO('mysql:host=localhost;dbname=recettes', 'root', 'root');
include("C:/wamp64/www/doc/ip_visiteurs.php");
$req = $bdd->prepare('UPDATE cuisine SET visiteurs = visiteurs + 1');
$req->execute();
$req->closeCursor();
$req = $bdd->prepare('SELECT id_recette, visiteurs FROM cuisine');
$req->execute();
$data = $req->fetch(PDO::FETCH_OBJ);
$req->closeCursor();
?>
<?php echo $data->visiteurs;?> personnes ont vu cette recette.
ip_visiteurs.php
<?php
$bdd = new PDO('mysql:host=localhost;dbname=recettes', 'root', 'root');
$ip_user = $_SERVER['REMOTE_ADDR'];
$ins = $bdd->query('INSERT INTO info_visiteurs(ip) VALUES(\'' . $ip_user .'\') WHERE id_recette="1"');
?>