$query= "UPDATE details
SET password
AND cpassword = (SELECT newpassword
, cpassword
FROM resetpassword
WHERE resetpassword.email = details.email)
WHERE email = email";