BuddyPress and namespacing

Try using if ( class_exists( '\BP_Attachment', false ) )?

Could be that you need to tell PHP that the class is in the global namespace

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