<?php
$r=mysql_query("SELECT city.id as city_id, locality.id,locality.area_name ".
"FROM city, locality ".
"WHERE city.id = locality .city_id order by city_id");
while($rss=mysql_fetch_object($r))
{
?>
<legend><?=$rss->city_id?></legend>
<input type="checkbox" name="sub_type[]" id="sub_type" value="<?=$rss->id?>" />
<span><?=$rss->area_name?></span><br/>
<?php
}
?>
我正在以其城市ID作爲標籤顯示區域名稱。問題在於,由於周圍的while循環,會爲每個區域名稱添加此ID標籤。如何防止ID標籤被重複多次,以便複選框分組在他們所屬的城市ID下面?在迴路中使用不同標籤的多個複選框
HTTP:/ /www.99acres.com/property/advanced_search.php檢查我想要顯示的位置我的記錄 – user1138383 2012-01-12 13:21:17