WPDB SQL query with prepare() returning variable, not db value

The function bbp_forum_id() will directly echo its value, you want to use bbp_get_forum_id() which will return the value for use in the context of an API call.

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