Got an error of
Undefined index: mytext
because I've got a form wherein it has a button wherein it adds an input field dynamically! But what if I will not add an input field? Can it be possible that it will get passed the variable in the php code.
Here is my declaration of mytext variable
if ($_POST['mytext']) {
    foreach ( $_POST['mytext'] as $key=>$value ) {
    $values = mysqli_real_escape_string($conn, $value);
    $query = mysqli_query($conn,"INSERT INTO tblalumni_past_o (pastoccu, alum_id) VALUES ('$values', '$id')");
        }
    }
So can it get passed if the input field mytext is not in the form?
 
     
     
    