this is the form page that sends inputs to the database update page
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>patient</title></head><body><?php$state=0;$con = mysql_connect("localhost","root","");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("testDental", $con);$result = mysql_query("SELECT * FROM patient");echo "<table border=1>";echo "<FORM ACTION=\"patientUpdater.php\" method=\"post\">";while($row = mysql_fetch_array($result)){if($row['name']==$_POST[name]||$row['email']==$_POST[email]){$d=$row['day'];$m=$row['month'];$y=$row['year'];$p1=$row['phonenumber1'];$p2=$row['phonenumber2'];$fn=$row['firstname'];$ln=$row['lastname'];$e=$row['email'];echo "<tr><td>replace this</td><td>$d</td><td>$m</td><td>$y</td><td>$p1</td><td>$p2</td><td>$fn</td><td>$ln</td><td>$e</td></tr>";echo "<tr><td>with this</td><td><input type=\"text\" name=\"$d\" value=\"$d\" ></td><td><input type=\"text\" name=\"$m\" value=\"$m\"></td><td><input type=\"text\" name=\"$y\" value=\"$y\"></td><td><input type=\"text\" name=\"$p1\" value=\"$p1\"></td><td><input type=\"text\" name=\"$p2\" value=\"$p2\"></td><td><input type=\"text\" name=\"$fn\" value=\"$fn\"></td><td><input type=\"text\" name=\"$ln\" value=\"$ln\"></td><td><input type=\"text\" name=\"$e\" value=\"$e\"></td></tr>";}}echo "<tr><td><input type=\"submit\" name=\"submit\"</td></tr>";echo "</table>";echo "</FORM>";?></body></html>
this is the page that is supposed to update the database.There are no errors however nothing gets updated
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>patient</title></head>
<body>
<?php
$state=0;
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("testDental", $con);
$result = mysql_query("SELECT * FROM patient");
$err=0;
echo "<table border=1>";
echo "<FORM ACTION=\"patientUpdater.php\" method=\"post\">";
while($row = mysql_fetch_array($result)){
$d=$row['day'];
$m=$row['month'];
$y=$row['year'];
$p1=$row['phonenumber1'];
$p2=$row['phonenumber2'];
$fn=$row['firstname'];
$ln=$row['lastname'];
$e=$row['email'];
if(isSet($_POST[$d])&&$_POST[$d]!=""){
$ind=$_POST[$d];
mysql_query("UPDATE patient SET day ='$ind'
WHERE day =' $d'");
}
if(isSet($_POST[$m])&&$_POST[$m]!=""){
$ind=$_POST[$m];
if(!mysql_query("UPDATE patient SET month ='$ind'
WHERE month =' $m'")){
echo "error";
}
}
if(isSet($_POST[$y])&&$_POST[$y]!=""){
$ind=$_POST[$y];
if(!mysql_query("UPDATE patient SET year ='$ind'
WHERE year =' $y'")){
echo "error";
}
}
if(isSet($_POST[$p1])&&$_POST[$p1]!=""){
$ind=$_POST[$p1];
if(!mysql_query("UPDATE patient SET phonenumber1 ='$ind'
WHERE phonenumber1 =' $p1'")){
echo "error";
}
}
if(isSet($_POST[$p2])&&$_POST[$p2]!=""){
$ind=$_POST[$p2];
if(!mysql_query("UPDATE patient SET phonenumber2 ='$ind'
WHERE phonenumber2 =' $p2'")){
echo "error";
}
}
if(isSet($_POST[$fn])&&$_POST[$fn]!=""){
$ind=$_POST[$fn];
if(mysql_query("UPDATE patient SET firstname ='$ind'
WHERE firstname =' $fn'")){
echo "$_POST[$fn]";
}
}
if(isSet($_POST[$ln])&&$_POST[$ln]!=""){
$ind=$_POST[$ln];
if(!mysql_query("UPDATE patient SET lastname ='$ind'
WHERE lastname =' $ln'")){
echo "error";
}
}
if(isSet($_POST[$e])&&$_POST[$e]!=""){
$ind=$_POST[$e];
if(!mysql_query("UPDATE patient SET email ='$ind'
WHERE email =' $e'")){
echo "error";
}
}
}
mysql_close($con);
?>
</body>
</html>
any help will be greatly appreciated