I have this code
$SQL = "UPDATE cart SET a = ? WHERE b = ? AND c = ?";
if($stmt2 = mysqli_prepare($conn, $SQL )){
mysqli_stmt_bind_param($stmt2, "iii", $a1, $b1, $c1);
mysqli_stmt_execute($stmt2);
if(mysqli_affected_rows($conn)){
echo "updated";
mysqli_stmt_close($stmt2);
}
else
echo "nope";
}
I was figuring out why above code never work. I have debug every way that I know.
Lastly I delete the if condition. Somehow, it is working. Tried to browse on the internet to figure out what is the cause but did not find any. Can somebody please explain to me why does it happen so? I am a newbie to mysqli. Really need help :) thanks!