0

I have a problem with my PHP updating script. I'm using prepared statements with mysqli, but the code isn't working although I see no error.

$c=mysqli_connect('localhost','client','','bdd');
if (!$c) {    
    echo 'Erreur de connexion a la base de donnees';
} else {    
   if (isset($_POST['submit'])) {
     $faite=1;        
     for($i=0;$i<sizeof($idg);$i++){
        $var=$idg[$i]; 
        $update="UPDATE  graissage SET   faite= ? where  id=?";
        echo $update;
        $stmt2= mysqli_prepare($c, $update);
        echo mysqli_error($c);
        mysqli_stmt_bind_param($stmt2, "is", $faite,$var);
        echo mysqli_error($c);
        mysqli_stmt_execute($stmt2);
        echo mysqli_error($c);
    }
}}
halfer
  • 19,824
  • 17
  • 99
  • 186

0 Answers0