<?php
    include_once 'opendb.php';
    $next_code ='';
    if (isset($_GET["AppID"]))
    {
        $AppID=$_GET["AppID"] ;
        $client_Code=$_GET["client_Code"] ;
        $sql = "INSERT INTO subsidiary (AppID1,AppID2,comp_id) " .
               " VALUES ('$AppID','$client_Code',0)";
        if ($conn->query($sql) === TRUE)
        {
           $Eno = $conn->insert_id;
           $next_code = $Eno;
        } else
        {
           die ( "Error in insert Req :" . $sql . "<br>" . $conn->error);
        } 
    }
    else
    {
        $next_code = "Error : No Data for app id";
    }
    $conn->close();
    echo $next_code;
?>