is there a way to use multiples mysql UPDATE with only 1 query?
I need something like this but the code below seems to be not right.
$sql = "UPDATE car_models SET date='$date' WHERE ";
foreach ( $modelos as $mod ){
$sql .= "(name='$mod->Label' AND car='$mod->model') AND ";
}
$sql = substr($sql, 0, -4);
$res = mysqli_query($con, $sql);
At the end I was expecting to have the $sql like this:
$sql = "UPDATE car_models SET date='$date' WHERE (name='$mod->Label' AND car='$mod->model') AND (name='$mod->Label' AND car='$mod->model') AND (name='$mod->Label' AND car='$mod->model')";
Should it work? Or there is a different way to do this?
Thanks