Performing ajax request in wordpress

Some actions must be registered as early as possible. When you put it in the "current_page_function" method, (depending on your program) it might be too late.

Hence, the wp_ajax_* hook cannot find your action, and it returns the error.

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