0
試圖數據提取到的下拉列表,但沒有結果被示出woocommerce拉數據到動態下拉列表形式
<form method="POST" action="city_processProduct.php?action=cityDest">
<td class="label" align="center">
<?php global $wpdb;
// get all countries
$sql1 = "SELECT city_countries_country
FROM city_callingfrom_countries
ORDER BY city_countries_country";
$result1 = $wpdb->get_results($sql1);
?>
<select name="dest[]" size="5" multiple>
<?php global $wpdb;
while($row1 = $wpdb->get_results($result1)) {
extract($row1);
echo"<option value='$row1->$city_countries_country</option> ";
}
?>
</select>
</form>
然而,當我回聲db錶行不形它得到結果
<?php global $wpdb;
$sql1 = $wpdb->get_results ("SELECT city_countries_country
FROM city_countries
ORDER BY city_countries_country");
foreach ($sql1 as $result){
echo "$result->city_countries_country</br>";
}
?>