Can’t access WordPress functions in file called via Ajax?

The reason for this error is that your loading the file without loading in the WordPress system and so wp_query() doesnt exist.

Quick fix is to:

include("../../../wp-load.php"); <– guessing at the location of the wordpress file.

at the top of the php file.

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