how to insert data in wordpress table usnig jquery ajax

The code you have shared can work in core PHP and not in WordPress. Using AJAX in WordPress plugin is explained in WordPress documentation. Please refer – https://codex.wordpress.org/AJAX_in_Plugins

I have tried this and it works well.

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