0

Guys I tried this code:

$wpdb->get_results(sprintf("SELECT ID FROM wp_posts WHERE ID = '%s' AND post_type = 'edd_payment'",$id));

it returned an std class How can I get data form db as array not stdclass?

2

1 Answer 1

1

See here $wpdb->get_results

$wpdb->get_results($query,ARRAY_A );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.