HOW do I check if password is updated in a table
<p>I writing a script in php to reset user's password, and
how Do I check if password is updated in a table? For example, if a data in tuple has been changed, then send email. Please check comments in the script.</p>

<pre><code> $dbcc = mysqli_connect(HOST,NAME,PASSWORD,DATABASE) or die('Error can not connect to database');
            $querr="SELECT uid,email FROM `corporate` WHERE (email='$chk_email')";
            $resultt = mysqli_query($dbc,$querr);

            //found
            if(@mysqli_num_rows($resultt) == 1)
            {


                    $ROW = mysqli_fetch_array($resultt);
                    $sent_email = $ROW['email']; //get email
                    $id = $ROW['uid'];           //get uid

                    $new_password = generatePassword(8);//generates 8 char long random password 
                    $enc_password = md5($new_password); //encrypt

                    $statement = "UPDATE corpoorate SET password=".$enc_password." WHERE uid ='$id'";
                    $go = mysqli_query($dbcc,$statement) or die(mysqli_error());
                    mysqli_close($dbcc);

                       /*
                        * HOW DO I CHECK IF PASSWORD IS UPDATED IN THE DATABASE?
                        * IF IT IS, SEND EMAIL
                                                    * IF $go==true does not work!
                        **/
                    if($go==true){
                    $sendmessage = "We have generated a new password token for you.\n Your password is reset to ".$new_password." \n Please note that this password is not secure. Once you login, please reset your password.\n ";

                     mail($sent_email,'Password Reset',$sendmessage,'From: address@gmail.com');     
                                                                                    }                   

                     header("Location : http://limozoor.com/login/signin.php");
                     exit();    
        }//if
        mysqli_close($dbcc);
</code></pre>
