PHP SQL update using variables posted into form : <p>I have a form that takes variables from another form like so:</p>

<pre><code>$employeeid = $_POST['modifyid'];
$fname = $_POST['modifyfn'];
$lname = $_POST['modifyln'];
$staffno = $_POST['modifysn'];
$empusername = $_POST['modifyeu'];

&lt;/br&gt;
&lt;td&gt;&lt;form action="empmodify.php" method="post"&gt;
     &lt;?php echo 
     "&lt;div class='form-group'&gt;
            &lt;tr&gt;&lt;td&gt;ID:&lt;/td&gt;&lt;td&gt;
                &lt;input type='text' class='form-control' name='modid' value='" . $employeeid . "'/&gt;
            &lt;/td&gt;&lt;/tr&gt;
        &lt;/div&gt;

     &lt;div class='form-group'&gt;
            &lt;tr&gt;&lt;td&gt;First Name:&lt;/td&gt;&lt;td&gt;
                &lt;input type='text' class='form-control' name='modfn' value='" . $fname . "'/&gt;
            &lt;/td&gt;&lt;/tr&gt;
        &lt;/div&gt;

        &lt;div class='form-group'&gt;
            &lt;tr&gt;&lt;td&gt;Surname Name:&lt;/td&gt;&lt;td&gt;
                &lt;input type='text' class='form-control' name='modln' value='" . $lname . "'/&gt;
            &lt;/td&gt;&lt;/tr&gt;
        &lt;/div&gt;

        &lt;div class='form-group'&gt;
            &lt;tr&gt;&lt;td&gt;Staff number:&lt;/td&gt;&lt;td&gt;
                &lt;input type='text' class='form-control' name='modsn' value='" . $staffno . "'/&gt;
            &lt;/td&gt;&lt;/tr&gt;
        &lt;/div&gt;

        &lt;div class='form-group'&gt;
            &lt;tr&gt;&lt;td&gt;Username:&lt;/td&gt;&lt;td&gt;
                &lt;input type='text' class='form-control' name='modeu' value='" . $empusername . "'/&gt;
            &lt;/td&gt;&lt;/tr&gt;
        &lt;/div&gt;


     &lt;button type='submit' class='btn btn-default'&gt;Modify this Employee&lt;/button&gt;"?&gt;
            &lt;/form&gt;&lt;/td&gt;

  &lt;/div&gt;
</code></pre>

<p>These variables are already in the database - This part is working.  What I would like is that when the user clicks submit it updates the record with anything they have changed in this form.  Here is my empmodify.php:</p>

<pre><code>$employeeid = $_POST['modid'];
    $fname = $_POST['modfn'];
    $lname = $_POST['modln'];
    $staffno = $_POST['modsn'];
    $empusername = $_POST['modeu'];


   $result = mysql_query("UPDATE employee SET fname = '$fname', lname = '$lname', staffno = '$staffno', empusername = '$empusername' WHERE employeeid = '$employeeid'"); 
</code></pre>

<p>I have tried so many things with my variables but the update statement just doesn't seem to be working.  I tried single quotes, double quotes, post, and concatenating them but nothing.. any ideas? :)</p>
