How to pass parameters from jQuery ajax into PHP function?

The data you send from jQuey to PHP is in the $_POST variable. So you can use $_POST['projectid'] inside your PHP function to get the data.

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