Hi,
I want to check if the query ran correctly, so I used
mysql_affected_rows right after running query.
It does actually update data in the database when I
check it. However, mysql_affected_rows doesn't
return 1 even though it is definitely updating only
one row.
Here is my code.
if($p){ //if everything is OK
$query = "UPDATE table_login SET Password = PASSWORD('$p') WHERE Email = '" . $email."'";
$result = @($query);
if(mysql_affected_rows() == 1){
$message .= 'Your password has been changed.';
include('footer2.inc');
exit();
}else{
$message .= 'Your password could not be changed due to a system error.<br> We apologize for any inconvenience.';
}
mysql_close(); //close connection
Like I said, update query does work.
however,
if(mysql_affected_rows() ==1)
doesn't return 1, it skips inside of braces and
goes to else braces.
Do you know if there is something to use instead of
mysql_affected_rows() ?