email error and sql update