Question: how to get dropdown value in wordpress?
Answer: $result=$wpdb->get_results("select * from states"); foreach($result as $row) { $state_id=$row->state_id; $state_name=$row->state_name; if($SelectedStateId == $state_id){ echo '<option selected value='.