Please Use this :
CREATE PROCEDURE sp_update_userdetails
(
@firstname VARCHAR(300),@lastname VARCHAR(300),@email VARCHAR(300),@password VARCHAR(200),@phoneno VARCHAR(300),@photo VARCHAR(200)
)
as
BEGIN
IF EXISTS(SELECT * FROM user_details WHERE email=@email)
UPDATE user_details SET firstname=@firstname,lastname=@lastname,password=@password,phoneno=@phoneno,photo=@photo
WHERE user_details.email=@email
ELSE
INSERT INTO user_details(firstname,lastname,email,password,phoneno,photo)
VALUES
(
@firstname,@lastname,@email,@password,@phoneno,@photo
);
END