How to create a form that display license key (and email it to user) after the user enter their email and 10 digit code?

How to create a form that display license key (and email it to user) after the user enter their email and 10 digit code?

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