我的表格在表格中显示了所有 (85) 条记录以供可能更新。更新块:
$sql="SELECT * FROM $tbl_name ORDER BY id ASC";
$result=mysql_query($sql);
// Count table rows
$size=mysql_num_rows($result);
$i = 0;
while ($i < $size) {
$name = $_POST['name'][$i];
$phone = $_POST['phone'][$i];
$email = $_POST['email'][$i];
$jan1 = $_POST['jan1'][$i];
.
.
$dues1 = $_POST['dues1'][$i];
.
.
$id = $_POST['id'][$i];
$query = "UPDATE $tbl_name SET name = '$name', phone = '$phone', email = '$email', jan1 = '$jan1', feb2 = '$feb2', mar3 = '$mar3', apr4 = '$apr4', may5 = '$may5', jun6 = '$jun6', jul7 = '$jul7', aug8 = '$aug8', sep9 = '$sep9', oct10 = '$oct10', nov11 = '$nov11', dec12 = '$dec12', dues1 = '$dues1', dues2 = '$dues2', dues3 = '$dues3', dues4 = '$dues4', dues5 = '$dues5', dues6 = '$dues6', dues7 = '$dues7', dues8 = '$dues8', dues9 = '$dues9', dues10 = '$dues10', dues11 = '$dues11', dues12 = '$dues12' WHERE id = '$id'";
//Just to see what's neing updated....
echo "UPDATE $tbl_name SET name = '$name', phone = '$phone', email = '$email', jan1 = '$jan1', feb2 = '$feb2', mar3 = '$mar3', apr4 = '$apr4', may5 = '$may5', jun6 = '$jun6', jul7 = '$jul7', aug8 = '$aug8', sep9 = '$sep9', oct10 = '$oct10', nov11 = '$nov11', dec12 = '$dec12', dues1 = '$dues1', dues2 = '$dues2', dues3 = '$dues3', dues4 = '$dues4', dues5 = '$dues5', dues6 = '$dues6', dues7 = '$dues7', dues8 = '$dues8', dues9 = '$dues9', dues10 = '$dues10', dues11 = '$dues11', dues12 = '$dues12' WHERE id = '$id'";
echo "<hr>";
mysql_query($query) or die ("Error in query: $query");
++$i;
}
//header('Location: allselect.php');
?>
我的回声显示记录 57 的更新良好。记录 58 部分正常。其余的(最多 85 个)什么都没有。更新 rollcalltest 集名称 = ' *-明智的', 电话 = 'XXX-XXX-XXXX', 电子邮件 = ' * * @gmail.com', jan1 = '1', feb2 = '1', mar3 = '', apr4 = '1', may5 = '1 ', jun6 = '1', jul7 = '', aug8 = '', sep9 = '', oct10 = '', nov11 = '', dec12 = '', dues1 = '0', dues2 = '0', Dues3 = '', dues4 = '', dues5 = '', dues6 = '', dues7 = '', dues8 = '', dues9 = '', dues10 = '', dues11 = '', dues12 = '' id = '58' UPDATE rollcalltest SET name = '', phone = '', email = '', jan1 = '', feb2 = '', mar3 = '', apr4 = '', may5 = '', jun6 = '', jul7 = '',aug8 = '',sep9 = '',oct10 = '',nov11 = '',dec12 = '',dues1 = '',dues2 = '',dues3 = '',dues4 = '',dues5 = '', Dues6 = '',dues7 = '',dues8 = '',dues9 = '',dues10 = '',dues11 = '',dues12 = '' WHERE id = ''
我快疯了。想法?