可以做到:
如:
<script language="JavaScript">
<!--
var subcat = new Array();
<?
$tt="";
$sql68="select distinct city from bschool";
$result68=mysql_query($sql68);
$j=0;
while ($n=mysql_fetch_array($result68)) {
$sql69="select distinct county from bschool where city='$n[city]' and county!='$tt'";
$result69=mysql_query($sql69);
while ($n1=mysql_fetch_array($result69)) {
?>
subcat[<? echo $j; ?>] = new Array("<? echo $n1[county]; ?>","<? echo $n[city]; ?>","<? echo $n1[county]; ?>");
<?
$j=$j+1;
}
//$i=$i+1;
}
?>
</script>