I am trying to add checkbox for anonymous post on form post

First of all don’t ever edit core files. Your changes will be lost on update. WordPress has a great way to expand as needed called Plugin.

As you don’t have enough knowledge about how WordPress works I suggest to use this ready made solution to avoid any risk. Here is the link

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