<snip>
$query = "SELECT first_name FROM employees WHERE (first_name='$fn' AND email='$e' )";
$result = @mysql_query ($query);
$num = mysql_num_rows ($result);
if ($num == 1) {
$row = mysql_fetch_array($result, MYSQL_NUM);
// Make the query.
$query = "UPDATE employees SET email='$ne' WHERE user_id=$row[0]";
</snip>
You are selecting first_name and using the result which in your example would be "Phil" to update the same table where user_id is also "Phil"? And that query would look like:
UPDATE employees SET email='mynewpassworddisguisedasemailvariable' WHERE user_id=Phil
If user_id is the same as first_name and user_id is a string the above will fail.
If user_id is an integer the above will fail.
I would imagine that your first query should return user_id (which probably is an integer) that you could the use update your user information.
Example:
$query = "SELECT user_id FROM employees WHERE (first_name='$fn' AND email='$e' )";
//echo $query;
$result = mysql_query ($query) or die('Mysql threw an error: ' . mysql_error());
$num = mysql_num_rows ($result);
if ($num == 1) {
$row = mysql_fetch_array($result, MYSQL_NUM);
// Make the query.
$query = "UPDATE employees SET email='$ne' WHERE user_id=$row[0]";
//echo $query;
When facing problems like this, it's an advantage to echo your query. If you can't get the above to work, please post your echoed queries as well.
hth