Hi all,
How do I perform the below query only if there are no error messages? At the moment the query still runs if there are error messages.
Thanks.
// declare an empty error array
$error_message = array();
if(isset($submit))
{
if(!$location || $location == "0")
{
$error_message['location'] = '<p>Please Complete the location field</p>';
}
if(!$booked_by || $booked_by == "0")
{
$error_message['booked_by'] ='<p>Please complete the booking Field</p>';
}
// insert into db
$query = "INSERT INTO meeting ".
"VALUES(NULL, '$location', '$meeting_date', '$time_start', '$time_end', '$booked_by', '$note' )";
echo $query;
}