How to call a PHP function in WordPress when you click on a button?

Take a look at AJAX in Plugins which uses admin-ajax.php. This is a way for you to interact with WordPress via a javascript request to WordPress.

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