Ok, ive gone through your code, letter by letter, number by number. It now echo's only out 1 value
i.e.
UPDATE screens SET seat_status='Booked' WHERE (seat_number=45) AND seat_status='Empty'
so I though maybe i needed to i++ after the (UPDATE screens SET ...
e.g.
$test = ("12,23,34,45");
$seat_ary = explode(',' , $test);
// set up a counter
$i = 1;
foreach ($seat_ary as $val) {
if ($i = 1) {
$updateSQL = "UPDATE screens SET seat_status='Booked' WHERE (seat_number=$val";
$i++;
}
// after that just add the next seat no
else {
$updateSQL = $updateSQL .= " OR seat_number=$val ";
$i++;
}
}
$updateSQL = $updateSQL .= ") AND seat_status='Empty' ";
echo $updateSQL;
and again it only updates the one seat_number (the last one).
Im sorry if this is getting on your nerves
Many thanks