<?require('Include/conn.php');?>
.......
<tr><td> Country</td>
<td>
<?php
$result=mysql_query("select CouCd,CouName from country",$conn);
while ($row=mysql_fetch_array($result)) {
$CouCd=$row['CouCd'];
$str.="<option value=$CityCd>".$row['CouName']."</option>";
}
?>
<select name="Country" style="width:220px ">
<?php
echo "<option value=\"\"> </option>".$str;
?>
</select></td></tr>
<tr><td> State Code</td>
<td><?php
$str = ""; //重置$str
$sresult=mysql_query("select StateCd,StateName from state",$conn);
while ($srow=mysql_fetch_array($sresult)) {
$StateCd=$srow['StateCd'];
$str.="<option value=$StateCd>".$srow['StateName']."</option>";
}
?>
<select name="StateCd" style="width:220px ">
<?php
echo "<option value=\"\"> </option>".$str;
?>
</select></td></tr>
<?require('Include/conn.php');?>
.......
<tr><td> Country</td>
<td>
<?php
$result=mysql_query("select CouCd,CouName from country",$conn);
while ($row=mysql_fetch_array($result)) {
$CouCd=$row['CouCd'];
$str.="<option value=$CityCd>".$row['CouName']."</option>";
}
?>
<select name="Country" style="width:220px ">
<?php
echo "<option value=\"\"> </option>".$str;
?>
</select></td></tr>
<tr><td> State Code</td>
<td>
<select name="StateCd" style="width:220px "> <?php
$str = ""; //重置$str
$sresult=mysql_query("select StateCd,StateName from state",$conn);
while ($srow=mysql_fetch_array($sresult)) {
$StateCd=$srow['StateCd'];
$str.="<option value=$StateCd>".$srow['StateName']."</option>";
}
?>
</select></td></tr>
这样看看