Skip to main content
added 16 characters in body
Source Link
Nicolai Grossherr
  • 18.9k
  • 8
  • 64
  • 109

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 showsis an example on how to do it correct:

$dr = $wpdb->get_results(
    $wpdb->prepare(
        "SELECT %s* 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.

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 shows how to do it correct:

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

For additional information you should take a closer look at the codex Class Reference: wpdb.

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.

Source Link
Nicolai Grossherr
  • 18.9k
  • 8
  • 64
  • 109

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 shows how to do it correct:

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

For additional information you should take a closer look at the codex Class Reference: wpdb.