title: create form $post and on submit it sumbit the user id
body: <p>I have 2 tables users &amp; request,,, users works fine i can get the user id, im using userspice 4, i created the table named request, i created another form method post and created the insert.</p>
  
  <pre><code>&lt;?php
  
    $link = mysqli_connect("localhost", "xxxa", "xxxxx", "xxxx");
   if($link === false){
  die("ERROR: Could not connect. " . mysqli_connect_error());
     }
  
   // Escape user inputs for security
    $fname = mysqli_real_escape_string($link, $_POST['fname']);
    $lname = mysqli_real_escape_string($link, $_POST['lname']);
    $amount = mysqli_real_escape_string($link, $_POST['amount']);
   $cedula = mysqli_real_escape_string($link, $_POST['cedula']);
  </code></pre>
  
  <p>// attempt insert query execution</p>
  
  <pre><code>  $sql = "INSERT INTO request (fname, lname, amount, cedula )    VALUES      ('$_POST[fname]', '$_POST[lname]', '$_POST[amount]','$_POST[cedula]')";
      if(mysqli_query($link, $sql)){
    echo "Records added successfully.";
    } else{
  echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
    }
  
    // close connection
   mysqli_close($link);
  
  ?&gt;
  </code></pre>
  
  <p>now it works i got insert into my table, but i need also to  insert the user id at the submission moment, the form is located on user's account page, i need to submit the info along with the user id, so later on I can fetch based on user id, please help, i been searching around but can't find anything</p>