I want to do multiple query in one statement here is my code and it's not working.
$stmt = $mysqli->prepare("UPDATE menu SET DESCRIPTION= ('$txt1'), VISIBLE=('$ckHOME1')
where id='1';
UPDATE menu SET DESCRIPTION= ('$txt1'), VISIBLE=('$ckHOME1') where id='1';
UPDATE menu SET DESCRIPTION= ('$txt2'), VISIBLE=('$ckHOME2') where id='2';
UPDATE menu SET DESCRIPTION= ('$txt3'), VISIBLE=('$ckHOME3') where id='3';
UPDATE menu SET DESCRIPTION= ('$txt4'), VISIBLE=('$ckHOME4') where id='4';");
$stmt->execute();
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
mysqli_close($con);
}
mysqli_prepare, why are you interpolating variables instead of using placeholders?if(!mysqli_query...)are doing :D