Select column name dynamically mySQL Query

I guess one could argue that this is somewhat wordpress related, because you are trying to get_results() from $wpdb, but like @MarkKaplun said your problem is that you are using the SQL wrong. Below code is an example on how to do it correct:

$dr = $wpdb->get_results(
    $wpdb->prepare(
        "SELECT * FROM wp_shipping WHERE country = %s AND ID = %d",
        $country, $ids
    )
);

This is an example, you might have to fit it to your needs. For additional information you should take a closer look at the codex Class Reference: wpdb.

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