mysql_num_rows($res) should return the number of rows in your result set.
$res is the result set from mysql_query
$rec is is the row fetched from the result $res
Since you did a print_r($rec) and saw an array of values there must be at least one row.
this statement:
if(mysql_num_rows($res) > 0){
$updater = 1;
}
should replace This old statement:
if ($rec['updatefor'] != null){
$updater = 1;
Once the $updater flag is set to 1, it should set the hidden form value updater to 1 also. Then it will update your record instead of inserting it when you submit the form.