I have setup a MySQL database table consisting of 4 fields to be used to display employee pictures in a webpage. The 4 fields are empID, name, picture, bio. There is an HTML form where the user enters the employee name & other data to be changed on the webpage. I wanted to use the employee name as the lookup value. The php code is as follows:

PHP Code:
if ($Location == "MA")
  {
    $result = mysql_query("SELECT * FROM employeesMA WHERE name = '$StaffName' ")
        or die("SELECT Error: ".mysql_error());
   } else {
    $result = mysql_query("SELECT * FROM employeesWL WHERE name = '$StaffName' ")
        or die("SELECT Error: ".mysql_error());
   }
    $row = mysql_fetch_row($result);
    $CurrEmpKey = $row[0];
    $CurrStaffName = $row[1];
    $CurrStaffPicURL = $row[2];
    $CurrStaffDescription = $row[3];
    if ($StaffPicFile == "")
        {$StaffPicFile  = $CurrStaffPicURL; } 
    if ($StaffDescription == "")
        {$StaffDescription = $CurrStaffDescription; }
    if     ($_POST['StaffChoice'] == "Update" and $_POST['SubmitRecord'] == true)
        { if ($Location == "MA")
        {
            $result = mysql_query("UPDATE employeesMA SET name = '$StaffName', picture = '$StaffPicFile', bio = '$StaffDescription' WHERE name = '$StaffName' ");
        } else {
            $result = mysql_query("UPDATE employeesWoodlawn SET name = '$StaffName', picture = '$StaffPicFile', bio = '$StaffDescription' WHERE name = '$StaffName' ");
        }
    echo "Employee Updated: " . $StaffName;
    ?>            
    <h2>Record Updated &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <br><br>
    <a href="staffupdate.htm">Return to Update Form</a></h2>
    <?php
    
}
        
?>
The 1st 3 records in the table are Clay Myers, Lee Myers, Judy Myers. When attempting to update the data for Lee, the table is not changed. There are 2 other employees in the table with the same last name & the 1st employee of the 2 cannot be updated. Is this because of the way that php/MySQL is reading the table? The other employee records tested work without a problem.
Thanks for the help.

Bob McP