How to add AJAX in a custom PHP function using Google sheets API

How to add AJAX in a custom PHP function using Google sheets API

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