If validation on Update
I am trying to put a bit of validation on my update form. I only want the user to update the database if...
1) If the field 'New' (checkbox) = 'Cancelled' the field 'booked' cannot be null
AND
2) If the field 'trafficlight'(select) = 'G' the field 'booked' cannot be null
This is my code.. but it still updates the database even if the criteria isn't met.
// WA DataAssist Update
if ((isset($_POST["Update"]) || isset($_POST["Update_x"])) && (($_POST["New"]=='Cancelled' && isset($_POST["booked"]))
|| empty($_POST["New"])) && (($_POST["trafficlight"]=='G' && isset($_POST["booked"])) || $_POST["trafficlight"]!='G')) // Trigger