What I'm trying to do is:
If the age input in my form = 28, 30, 25 or 21 then I want to auto insert value 8 in the column (VE), else keep it empty. Is this the right way to do that?
if($form_data->action == 'Insert')
        {
            $age=array(28, 30, 25, 21);
            $age_str=implode("','", $age);
                if($form_data->age == $age_str){
                $query="INSERT INTO tbl
                        (VE) VALUE ('8') WHERE id= '".$form_data->id."'
                ";
                    $statement = $connect->prepare($query);
                    $statement->execute();
            }
            $data = array(
                ':date'             =>  $date,
                ':first_name'       =>  $first_name,
                ':last_name'        =>  $last_name,
                ':age'          =>  $age
            );
            $query = "
            INSERT INTO tbl
                (date, first_name, last_name, age) VALUES 
                (:date, :first_name, :last_name, :age)
            ";
            $statement = $connect->prepare($query);
            if($statement->execute($data))
            {
                $message = 'Data Inserted';
            }
        }
Also, how do I insert the new row with the row id from the other form data going into tbl?
 
     
    