How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?

I’ve explored both options, using custom fields and a custom taxonomy, in previous versions of my plugin, Posts 2 Posts. The latest version uses two custom tables.

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