create table with mysql populate with php
i created tables using mysql. im trying to populate them with my php code.if my tables are empty and i try to insert it gives error, but if i initially add with my sql after that my insert works perfectly. I spent hours but I couldn't fix it..how can I fix this issue
Thanks again 
 Notice: Undefined index:


    if (isset($_POST['action']) && $_POST['action']=='submitted') {
    
    $project_id = $_POST['project_id'];
    $title= $_POST['title'];
    $start_date = $_POST['start_date'];
    $end_date = $_POST['end_date'];
    $parent_project_id = $_POST['parent_project_id'];
    $is_completed= $_POST['is_completed'];
    $completion_date= $_POST['completion_date'];
    $user_id= $_POST['user_id'];
    $iproject_id = $_POST['iproject_id'];
    $ititle= $_POST['ititle'];
    $istart_date = $_POST['istart_date'];
    $iend_date = $_POST['iend_date'];
    $iparent_project_id = $_POST['iparent_project_id'];
    $iis_completed= $_POST['iis_completed'];
    $icompletion_date= $_POST['icompletion_date'];
    $iuser_id= $_POST['iuser_id'];


create table with mysql populate with php
===

i created tables using mysql. im trying to populate them with my php code.if my tables are empty and i try to insert it gives error, but if i initially add with my sql after that my insert works perfectly. I spent hours but I couldn't fix it..how can I fix this issue
Thanks again 
 Notice: Undefined index:


    if (isset($_POST['action']) && $_POST['action']=='submitted') {
    
    $project_id = $_POST['project_id'];
    $title= $_POST['title'];
    $start_date = $_POST['start_date'];
    $end_date = $_POST['end_date'];
    $parent_project_id = $_POST['parent_project_id'];
    $is_completed= $_POST['is_completed'];
    $completion_date= $_POST['completion_date'];
    $user_id= $_POST['user_id'];
    $iproject_id = $_POST['iproject_id'];
    $ititle= $_POST['ititle'];
    $istart_date = $_POST['istart_date'];
    $iend_date = $_POST['iend_date'];
    $iparent_project_id = $_POST['iparent_project_id'];
    $iis_completed= $_POST['iis_completed'];
    $icompletion_date= $_POST['icompletion_date'];
    $iuser_id= $_POST['iuser_id'];

