這裏是我的表上的部分代碼:PHP價值將不超過127
<br><input type="checkbox" checked="yes" name="country[]" value="1" />Asia/Pacific Region
<br><input type="checkbox" checked="yes" name="country[]" value="2" />Europe
<br><input type="checkbox" checked="yes" name="country[]" value="3" />Andorra
...
<br><input type="checkbox" checked="yes" name="country[]" value="250" />Jersey
<br><input type="checkbox" checked="yes" name="country[]" value="251" />Saint Barthelemy
<br><input type="checkbox" checked="yes" name="country[]" value="252" />Saint Martin
,這是我的PHP代碼:
$country=$_POST['country'];
...
foreach ($country as $country) {
$sql="INSERT INTO sites_countries (siteID, country) VALUES ('$id', '$country')";
# execute SQL command
if (!mysql_query($sql,$con)) {
die('Error: ' . mysql_error());
}
}
,但我看了看我的數據庫,它似乎只得到127,那麼$國家總是127
那麼我該如何改變它? – Hintswen 2009-05-23 11:06:14