WordPress function is not called and ajax return 0

Instead of url: ajaxurl + "?action=fdiAddFavorite",, use two lines like this:

url: ajaxurl,
action: "fdiAddFavorite",

Then at the end of fdiAddFavorite(), you try something like this:

echo $favorite_list; // could also send message like "success!"
wp_die();

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