Mini Kabibi Habibi

Current Path : C:/Users/ITO/Desktop/From USB/fts/ADMIN/
Upload File :
Current File : C:/Users/ITO/Desktop/From USB/fts/ADMIN/codepsp.php

<?php
session_start();
$con = mysqli_connect("localhost","root","","personnel");

if(isset($_POST['save_multiple_data']))
{   
    $username = $_POST['username'];
    $name = $_POST['name'];
    $phone = $_POST['phone'];

    foreach($username as $index => $usernames)
    {   
        $s_username = $usernames;
        $s_name = $name[$index];
        $s_phone = $phone[$index];
        // $s_otherfiled = $empid[$index];

        $query = "INSERT INTO children_name (username,child_name,child_birth) VALUES ('$s_username','$s_name','$s_phone')";
        $query_run = mysqli_query($con, $query);
    }

    if($query_run)
    {
        $_SESSION['status'] = "Multiple Data Inserted Successfully";
        header("Location: profile.php");
        exit(0);
    }
    else
    {
        $_SESSION['status'] = "Data Not Inserted";
        header("Location: children.php");
        exit(0);
    }
}
?>