plugin ajax to external php file always return null

I solved it

instead of using

return ( $result == true ? 'success' : 'error' );

use

echo ( $result == true ? 'success' : 'error' );

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