WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In plugin development, how to fetch data from database of particular data in dropdown list?

global $wpdb;
$id = 'parent_id';
$data = $wpdb->get_results("SELECT * FROM wp_postmeta WHERE meta_key = $id"); 
echo $data;

i get results as array how can i get all values in dropdown list? Can you please help?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.