title: Two forms, two seperate pages want the first form to write to a table in sql and the second form to add to that specific table filling in the blanks
body: <p>( Just a fun little experiment for my first website )
  So this part works fine, it receives the information that is inputted from the form on another page. It adds to the "user" table in which consists of 'user', 'pass' (which are added from this given php code) and also 'ID' which auto increments upon adding to the table and then
  'screen_name' and 'email' which I want to further add to the given table via another form.</p>
  
  <pre><code>&lt;?
      session_start();
      include('dbconn.php');
      $username = $_POST['user'];
      $password = $_POST['pass'];
      $sql = "INSERT INTO `user`(`user`, `pass`) VALUES ('".$username."','".$password."')";
      $run = mysql_query($sql);
  
      if($run){
          $_SESSION['username'] = $username;
  
      }
  ?&gt;
  </code></pre>
  
  <p>This part of the code asks for an email address and a screen name which will be then further stored within the database, however I would like it to add to the specific user's information. As 'user' and 'pass' are already saved, the idea is to further then add 'screen_name' and 'email' to that specific user. Not sure what i've done wrong here. Also each time I refresh the page a blank user is added to a field in the database.</p>
  
  <pre><code>       &lt;form id="contact-form" method="post"&gt;
              &lt;div&gt;
                  &lt;label&gt;
                      &lt;span&gt;Userame/Screen Name:&lt;/span&gt;
                      &lt;input placeholder="Please enter your name" name="screen_name" type="text" tabindex="1" required autofocus&gt;
                  &lt;/label&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;label&gt;
                      &lt;span&gt;Email:&lt;/span&gt;
                      &lt;input placeholder="Please enter your email address" name="email" type="email" tabindex="2" required&gt;
                  &lt;/label&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;button name="submit" type="submit" id="contact-submit" data-text="...Sending"&gt;Submit&lt;/button&gt;
              &lt;/div&gt;
                  &lt;input type="hidden" name="user" value="&lt;?php echo $_POST['user']; ?&gt; /&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>Here is the code which is connected to the above form, it is on the same page and for some reason I am having trouble getting it to even add to any fields within the database let alone the one that is already active for the new user.</p>
  
  <pre><code>&lt;?php
  session_start();
  include('dbconn.php');
  $screen_name = $_POST['screen_name'];
  $email = $_POST['email'];
  $sql = "UPDATE `user` SET `screen_name` = '$screen_name', `email` = '$email' WHERE user = $username";
  $run = mysql_query($sql);
  ?&gt;  
  </code></pre>
  
  <p>Any help would be more than appreciated. Not usually a guy who asks for help but as being stuck on this problem for ages and looking through multiple Stackoverflow posts, thought I'd add my own question!</p>