Here I'm able to collect data and place all the records under editing mode and able to edit the records. But when posting the record only the last record is getting posted.
$result = mysql_query("SELECT * FROM $table WHERE surname = '$surname' and add1 = '$add1' ORDER BY add1",$db);
$new = stripslashes($area);
$new2 = htmlspecialchars("$new", ENT_QUOTES);
$new1 = stripslashes($new2);
$rn = mysql_numrows($result);
echo "Total Number of Records under $surname ($rn)<br>";
echo "<a href=/ab/>home</a> » <a href='name-view.php?area=$new1'>$new1<a> » <a href='name-detail-view.php?surname=$surname&area=$new1'>$surname</a> » $add1<br>";
echo " <form method=post action='xyz.php'>";
echo "<table cellpadding=2 cellspacing=1 border=0 width=100%>";
echo "<tr class=hdr><td>Name</td><td>Address</td><td>Gender</td><td>Religion<br>Sub</td><td>Family</td><td>Tel-Mob-Fax</td><td>Email</td></tr>";
$alternate = "2";
while ($row = mysql_fetch_array($result)) {
$id = $row["id"];
$surname = $row["surname"];
$forename = $row["forename"];
$mobile = $row["mobile"];
$email = $row["email"];
$gender = $row["gender"];
$religion = $row["religion"];
$sub_rel = $row["sub_rel"];
$family = $row["family"];
$tel = $row["tel"];
$fax = $row["fax"];
$add1 = $row["add1"];
$area = $row["area"];
$district = $row["district"];
$b = mysql_numrows($result);
if ($alternate == "1") {
$color = "#ffffff";
$alternate = "2";
}
else {
$color = "#efefef";
$alternate = "1";
}
echo"<input type=hidden name=b value='$b'/><input type=hidden name=id value='$id'/><tr><tr bgcolor=$color><td nowrap valign=top><input type=text name=surname size=20 value='$surname'/><br><input type=text name=forename size=20 value='$forename'/><br></td>
<td nowrap valign=top><input type=text name=add1 size=40 value='$add1'/><br><input type=text name=area size=40 value='$area'/><br><input type=text name=district value='$district'/></td><td valign=top><input type=text name=gender size=10 value='$gender'/></td><td valign=top><input type=text name=religion size=10 value='$religion'/><br><input type=text name=sub_rel size=10 value='$sub_rel'/></td><td valign=top><input type=text name=family size=15 value='$surname'/></td><td valign=top nowrap>T :<input type=text name=tel size=10 value='$tel'/><br>M :<input type=text name=mobile size=10 value='$mobile'/> <br>F :<input type=text name=fax size=10 value='$fax'/> </td><td valign=top><input type=text name=email value='$email'/></td></tr>";
}
//echo "<tr><td colspan=5><a href='edit-rec.php?'>UPDATE $table SET religion = 'muslim', sub_rel = 'muslim', family = '$surname' WHERE surname ='$surname' AND add1='$add1' </td></tr>";
echo "</table>";
echo "<input type=Submit name=update value='Update information'>";
How can i post all the records to update page.
What are the ways to post entire records.
(e.g changing record no 2,5,6,7,8,9,10,20 with different values i would like to see all the records with the values being posted)