title: How do I edit a specific row in SQL using PHP
body: <p>I am fairly new to PHP and SQL.
  I want to be able to assign a task to a certain user and the update that row in the database with the user's name assigned to that task.
  Here is my code:</p>
  
  <pre><code>&lt;table border="0" width="1100px" style= "font-size: 12px" &gt;
    &lt;thead&gt;
      &lt;tr valign="top" align="left"&gt;
      &lt;th height="20"&gt;&lt;/th&gt;
        &lt;th height="20"&gt;Customer&lt;/th&gt;
        &lt;th&gt;Vehicle&lt;/th&gt;
        &lt;th&gt;Appt Time&lt;/th&gt;
        &lt;th&gt;Notes&lt;/th&gt;
        &lt;th&gt;Assign&lt;/th&gt;
        &lt;th&gt;Action&lt;/th&gt;
        &lt;tr&gt;&lt;td valign="top" colspan="6"&gt;&lt;hr&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;?php
        while( $row = mysql_fetch_assoc( $result ) ){
          echo
          "&lt;tr valign='center'&gt;
  
            &lt;td width='50'&gt;&lt;b&gt;{$row['id']}&lt;/td&gt;
  
              &lt;td width='220' height='70'&gt;&lt;b&gt;{$row['firstname']}
            &lt;/td&gt;
  
  
            &lt;td width='240'&gt;&lt;b&gt;{$row['car']}&lt;/b&gt; &lt;br&gt;{$row['reg']}&lt;/td&gt;
            &lt;td width='170'&gt;Monday&lt;br&gt;24 September&lt;br&gt;17:00&lt;/td&gt;
  
            &lt;td width='240'&gt;{$row['notes']}&lt;br&gt;&lt;b&gt;Status:&lt;/td&gt;
            &lt;td width='240'&gt;
            &lt;form action='bookings.php' method='post'&gt;
            &lt;select style='width:90px' class='reg' name='assign'required&gt;
            &lt;option value=''&gt;&lt;/option&gt;
            &lt;option value='User1'&gt;User1&lt;/option&gt;
            &lt;option value='User2'&gt;User2&lt;/option&gt;
            &lt;option value='User3'&gt;User3&lt;/option&gt;
            &lt;option value='User4'&gt;User4&lt;/option&gt;
            &lt;option value='User5'&gt;User5&lt;/option&gt;
           &lt;/select&gt;&lt;input type='submit' value='&gt;'  class='assignButton'/&gt;&lt;/form&gt;
            &lt;/td&gt;&lt;td&gt;
            &lt;button class='myButton'&gt;Edit&lt;/button&gt;
            &lt;/td&gt;
            &lt;tr&gt;&lt;td colspan='6'&gt;&lt;hr class='hrTitle'&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;/tr&gt;\n";
        }  
      ?&gt;
  
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>As you can see, I have a number of users that can be selected, I want to be able to assign that task to a user from the select list.
  Any help is much appreciated.</p>