Here is the full code 😕
<?php
// Retreiving Form Elements from Form
$Fname = $_POST['efname'];
$Mname = $_POST['emname'];
$Lname = $_POST['elname'];
$Cell = $_POST['ecell'];
echo $Mname;
$con = mysql_connect("localhost","test","123");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("users", $con);
$query = 'SELECT COUNT(*) FROM list WHERE fname=' . $Mname;
$result = mysql_query($query) or die('MySQL Error: ' . mysql_error() . '<hr/>' . $query);
echo 'There were <b>' . mysql_num_rows($result) . '</b> rows found.';
mysql_query("UPDATE list SET fname='$Fname', mname=$'$Mname', lname='$Lname', cell='$Cell', WHERE cell='$Cell'");
printf("Records edited: %d\n", mysql_affected_rows());
mysql_close($con);
echo "Record Updated";
?>
I found an error(lsit insted of list) I corrected it (The code above is the corrected version)
When I ran it I got this result
There were 1 rows found. Records edited: -1 Record Updated
And the update still do nothing 😕