<?php
mysql_query("SELECT * FROM page where page_id = '$page_id'") or die(mysql_error());
while($land = mysql_fetch_array($resultxx)){
$land =$land['land'];
?>
输出$land
为NL,DE,BE,AL..
如何分割输出
例如
<?php
echo "
<select>
<option value='NL'>NL</option>
<option value='DE'>DE</option>
<option value='BE'>BE</option>
<option value='AL'>AL</option>
</select>";
}
?>
答案 0 :(得分:0)
试试这个
<?php
mysql_query("SELECT * FROM page where page_id = '$page_id'") or die(mysql_error());
while($land = mysql_fetch_array($resultxx)){
$land =$land['land'];
$landarray = explode(",",$land);
$count = count($landarray);
echo "<select>";
for($i=0;$i<$count;$i++){
echo '<option value='.$landarray[$i].'>'.$landarray[$i].'</option>';
}
echo "</select>";
}
?>