mysql on duplicate key update the entire row
You used:

INSERT INTO contacts 
    (id, ssn, name, gender, dob, address, profession, phone) 
VALUES 
    (default, 1, 2, 3, 4, 5, 6, 7) 
ON DUPLICATE KEY UPDATE
    ssn = VALUES(1) ;


where 1, 2, 3, .. are the values passed form the application (check your method by the way, seems like it's vulnerable to SQL injection) 

The error you get is because VALUES(1) is not valid syntax. The last line should be either:

    ssn = 1 ;               -- the value , repeated


or:

    ssn = VALUES(ssn) ;     -- reference to the value that was 
                            -- to be inserted to column "ssn"