I am trying to get a values from the drop down displayed from table .
i have tried in diff ways but i don't know where i have gone wrong.
Can any one help me on this..
Below is my code.
<tr class="form-field" id="appid">
<div>
<th valign="top" scope="row" >
<label for="country"><?php _e('country', 'custom_table_example')?></label>
</th>
<td>
<select id="country" name="country" class="code" >;
<option value="">select country</option>
<?php
global $wpdb;
$coun_name = $wpdb->get_col("select country_name FROM countries") ;
//print_r($coun_name);
foreach($coun_name as $a)
{
echo '<option value="'. strtolower($a) .'" />' . "$a </option>";
}
?>
</td>
</div>
</tr>
The above code is displaying values into drop down.
now the problem is i need to get the selected values.
echo '<option value="'. strtolower($a) .'"<?php echo $item['country']==".$a."?'selected="selected"':'' ?> />' . "$a </option>";
$item is the variable where i am storing all data.
country =name attribute.