Query posts by custom fields (object post)

If you use Post Object field type, then it is stored as ID in custom field. So this should do the trick:

$posts = get_posts(array(
    'numberposts'   => -1,
    'post_type'     => 'post',
    'meta_key'      => '<FIELD_NAME>',
    'meta_value'    => <POST_ID>
));

PS. You should use ‘posts_per_page’ instead of ‘numberposts’ (which is deprecated).

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