title: PHP edit TABLE A, display into textbox then save it into TABLE B
body: <p>TABLE CREW(A) - user_id, name, username, status<br>
  TABLE DATA(B) - user_id, name, username, password, month, status</p>
  
  <p>records came from <strong>table a</strong>. my idea to solve this:</p>
  
  <p>search record from <strong>table a</strong>, edit the record
  add new textbox for password and month then save it into <strong>table b</strong>.</p>
  
  <p>I have successfully pullout the record from table a but unable to save it to table b. It's able to save the record but only save the user_id and the month, with the rest of the columns missing. </p>
  
  <p>updateform.php:</p>
  
  <pre><code>&lt;?PHP
  $sql = "SELECT * FROM crew WHERE user_id = $sel_record";
          $result = mysql_query($sql, $con) or die (mysql_error());
          if(!$result) {
              print "&lt;h1&gt;Something has gone wrong!&lt;/h1&gt;";
          } else {
              while ($record = mysql_fetch_array($result)) {
                  $user_id = $record['user_id'];
                  $lname = $record['lname'];
                  $username = $record['username'];
                  $status = $record['status'];
              } 
  &lt;form id = "myForm" method="POST" action = "update.php"&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;label for="user_id"&gt;Crew ID*:&lt;/label&gt;&lt;/td&gt;&lt;td&gt;
              &lt;input type="text" name="user_id" id="user_id" value="$user_id" &gt;
          &lt;/td&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;label for="lname"&gt;LastName*:&lt;/label&gt;&lt;/td&gt;&lt;td&gt;
              &lt;input type="text" name="lname" id="lname" value="$lname" &gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;tr&gt;
          &lt;td&gt;
              &lt;label for="username"&gt;Username*:&lt;/label&gt;&lt;/td&gt;&lt;td&gt;
              &lt;input type="text" name="username" id="username" value="$username" &gt;
          &lt;/td&gt;
      &lt;/tr&gt;       
  &lt;tr&gt;
          &lt;td&gt;
              &lt;label for="password"&gt;Password*:&lt;/label&gt;&lt;/td&gt;&lt;td&gt;
              &lt;input type="text" name="password" id="password" value="$username" &gt;
          &lt;/td&gt;
      &lt;/tr&gt;                                                       
      &lt;tr&gt;
          &lt;td&gt;
              &lt;label for="month"&gt;Month*:&lt;/label&gt;&lt;/td&gt;&lt;td&gt;
              &lt;input type="text" name="month" id="month" value="$month" &gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;tr&gt;
          &lt;td&gt;
              &lt;label for="status"&gt;Status*:&lt;/label&gt;&lt;/td&gt;&lt;td&gt;
              &lt;input type="text" name="status" id="status" value="$status" &gt;
          &lt;/td&gt;
      &lt;/tr&gt;   
      &lt;tr&gt;
      &lt;td id="mySubmit"&gt;
          &lt;input type="submit" name="submit" value="Modify Record"&gt;   
      &lt;/td&gt;
      &lt;/form&gt;
  ?&gt;
  
  ***update.php
  &lt;?PHP
  include "connect.php";
  $user_id = $_POST[user_id];
  $lname = $_POST[lname];
  $username = $_POST[username];
  $password = $_POST[password];
  $status = $_POST[status];
  $month = $_POST[month];
  
  $sql = "INSERT INTO data (user_id, lname, username, password, month, status) VALUES ('$user_id', '$lname', '$username', '$password', '$month', '$status')";
  $result=mysql_query($sql) or die (mysql_error());`enter code here`
  ?&gt;
  </code></pre>