title: Update fields in specific database row
body: <p>I am trying to insert information from a form on a website into a specific row on a database. These specific rows are defined by the unique key <code>'username'</code>. In the webpage that the form is on, the <code>'username'</code> field is equal to the session variable <code>$_SESSION['MM_Username']</code>.  </p>
  
  <p>Currently, the information inserts it into a record with <code>username=""</code>.  </p>
  
  <p>How do I get it so the form updates information in the correct row of the database (the one where <code>username=$_SESSION['MM_Username'])</code>?</p>
  
  <p>The code I currently have (created automatically by Dreamweaver is):</p>
  
  <pre><code>if ((isset($_POST["MM_insert"])) &amp;&amp; ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO users,(firstname, lastname, address1, address2, city,    `state`, postcode, country, phone, guitar, guitar1, guitar2, guitar3, guitar4, price, price1, price2, price3, price4) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", 
                     GetSQLValueString($_POST['firstname'], "text"),
                     GetSQLValueString($_POST['lastname'], "text"),
                     GetSQLValueString($_POST['address1'], "text"),
                     GetSQLValueString($_POST['address2'], "text"),
                     GetSQLValueString($_POST['city'], "text"),
                     GetSQLValueString($_POST['state'], "text"),
                     GetSQLValueString($_POST['postcode'], "text"),
                     GetSQLValueString($_POST['country'], "text"),
                     GetSQLValueString($_POST['phone'], "text"),
                     GetSQLValueString($_POST['guitar'], "text"),
                     GetSQLValueString($_POST['guitar1'], "text"),
                     GetSQLValueString($_POST['guitar2'], "text"),
                     GetSQLValueString($_POST['guitar3'], "text"),
                     GetSQLValueString($_POST['guitar4'], "text"),
                     GetSQLValueString($_POST['price'], "text"),
                     GetSQLValueString($_POST['price1'], "text"),
                     GetSQLValueString($_POST['price2'], "text"),
                     GetSQLValueString($_POST['price3'], "text"),
                     GetSQLValueString($_POST['price4'], "text")
              );
  
   mysql_select_db($database_connectDB, $connectDB);
   $Result1 = mysql_query($insertSQL, $connectDB) or die(mysql_error());
  
   $insertGoTo = "/site/dashboard.php";
   if (isset($_SERVER['QUERY_STRING'])) {
   $insertGoTo .= (strpos($insertGoTo, '?')) ? "&amp;" : "?";
   $insertGoTo .= $_SERVER['QUERY_STRING'];
   }
   header(sprintf("Location: %s", $insertGoTo));
   }
  </code></pre>