私のフォームは、可能な更新のためにすべての (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) 何もありません。UPDATE rollcalltest SET name = ' *-賢い'、電話 = '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 = '' WHERE 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 = ''
私は夢中になります。アイデア?