Q:

How to pass an id of current item to request table

I have an application where a user can send request edit to the admin, now the problem is how to store the id of the requested asset from user_asset table to the request table so I can display it to the admin's page with full details of the asset
when the user clicks on the request edit he gets a form with editable fields filled with current information but how can I store this asset's id so I can fetch it to the admin's table with information from both tables (user_assets, requests)
I have user_asset table 
asset_id
asset_category
code
title
userid

and requests table
id
reason
assetid
user_id

this is what I have done so far
    if(isset($_POST['submit'])){

    // get all values from input with no special charactere

   $code = mysqli_real_escape_string($conn, $_POST['code']);

   $asset_id =  mysqli_real_escape_string($conn, $_GET['id']); 
   $reason =  mysqli_real_escape_string($conn, $_POST['reason']);

    if (!$error) {

      if (!$error) {
         // execute the sql insert 
            if(mysqli_query($conn, "INSERT INTO `requests`(id,reason,assetid, user_id) 
                 VALUES( null, '" . $reason . "', '". $asset_id ."','" .$_SESSION['user_id'] . "')")) {
              // if the insert result was true (OK)
              $success_message = "req was successfully added ! ";
           } else {
              // if the insert result was false (KO)
              $error_message = "Error in data...Please try again later!";
           }
        }
   }

}

else{
   if(isset($_GET['idedit']) ){
       $result = mysqli_query($conn, "SELECT * from user_asset WHERE asset_id=".$_GET['idedit']);
       $project = mysqli_fetch_array($result);
   }

}

   ?>

and this is my form
            <form method="post" action="req_ade.php" id="adding_new_assets">

                                    <div class="control-group">
                                       <label  for="basicinput">الکود : </label>
                                       <div class="controls">
                                          <input type="number" id="basicinput" value="<?php echo $project['code']; ?>" placeholder="الكود" name="code" class="span8">
                                       </div>
                                    </div>

                                    <div class="control-group">
                                       <label  for="basicinput">التفاصيل : </label>
                                       <div class="controls">
                                          <input type="text" id="basicinput" value="<?php echo $project['title']; ?>" placeholder="التفاصيل" name="title" class="span8">
                                       </div>
                                    </div>

                                    <div>
                             <label style="color:black">السبب</label>
                             <textarea rows="8" cols="8" name="reason" class="form-control" placeholder="اذكر سبب التعديل ..." ></textarea>

                            </div>

                                    <div class="control-group">
                                       <div class="controls">
                                          <button type="submit" name="submit" class="btn">طلب تعديل</button>
                                       </div>
                                    </div>
                                 </form>

these are the errors I'm getting
Notice: Undefined index: id in D:\wamp64\www\Caprabia-test\req_ade.php on line 28

Fatal error: Uncaught exception 'mysqli_sql_exception' with message 'Incorrect integer value: '' for column 'assetid' at row 1' in D:\wamp64\www\Caprabia-test\req_ade.php on line 37

( ! ) mysqli_sql_exception: Incorrect integer value: '' for column 'assetid' at row 1 in D:\wamp64\www\Caprabia-test\req_ade.php on line 37

A:

Thank you for all your suggestions.
After trying a lot of suggestions and manipulating with the code I have found a solution for it.
if(isset($_POST['submit'])){

   // get all values from input with no special charactere

  $code = mysqli_real_escape_string($conn, $_POST['code']);

  $asset_id =  mysqli_real_escape_string($conn, $_POST['asset_id']); 
  $reason =  mysqli_real_escape_string($conn, $_POST['reason']);

   if (!$error) {

     if (!$error) {
        // execute the sql insert 
           if(mysqli_query($conn, "INSERT INTO `requests1`(id,reason,assetid, user_id) 
                VALUES( null, '" . $reason . "', '". $asset_id ."','" .$_SESSION['user_id'] . "')")) {
             // if the insert result was true (OK)
             $success_message = "req was successfully added ! ";
          } else {
             // if the insert result was false (KO)
             $error_message = "Error in data...Please try again later!";
          }
       }
  }

}

else{
   if(isset($_GET['idedit']) ){
       $result = mysqli_query($conn, "SELECT * from user_asset WHERE asset_id=".$_GET['idedit']);
       $project = mysqli_fetch_array($result);
   }

}

and this is the form I have posted the asset_id in a hidden type
  <form method="post" action="req_ade1.php" id="adding_new_assets">

                                    <div class="control-group">
                                       <label  for="basicinput">الکود : </label>
                                       <div class="controls">
                                       <input type="hidden" value="<?php echo $project['asset_id'];?>" name="asset_id" />
                                       <input type="number" id="basicinput" value="<?php echo $project['code']; ?>" placeholder="الكود" name="code" class="span8">
                                       </div>
                                    </div>

                                    <div class="control-group">
                                       <label  for="basicinput">التفاصيل : </label>
                                       <div class="controls">
                                          <input type="text" id="basicinput" value="<?php echo $project['title']; ?>" placeholder="التفاصيل" name="title" class="span8">
                                       </div>
                                    </div>

                                    <div>
                             <label style="color:black">السبب</label>
                             <textarea rows="8" cols="8" name="reason" class="form-control" placeholder="اذكر سبب التعديل ..." ></textarea>

                            </div>

                                    <div class="control-group">
                                       <div class="controls">
                                          <button type="submit" name="submit" class="btn">طلب تعديل</button>
                                       </div>
                                    </div>
                                 </form>

