How to generate random codes that have to be entered to access a Mailchimp form?

Can you precise your question ? Is it something you need to protect your form and avoid robots and spam ? If yes, I think you should use an existant CAPTCHA like Google reCaptcha or an alternative such as VisualCaptcha or Honeypot method.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)