$con=mysqli_connect('localhost', "rayees", "rsubaisha", "taskmonitor"); if($con) { //echo "connection done"; } else { //echo "connection error"; } if(isset($_POST["submit"])) { $username = $_POST["username"]; $currentPass = $_POST["currentPass"]; $newPass = $_POST["newPass"]; //echo $currentPass.$newPass; $sql0 = "select * from userMaster where userName = '$username' and password = '$currentPass' "; $query0 = mysqli_query($con,$sql0 ) or mysqli_error(); $rowCount = mysqli_num_rows($query0); if($rowCount == '1') { //Slno activityId activityName priority dateInit area taskCo remarks status lastUpdated deadline category //echo $area." ".$category." ".$activity." ". $taskcoordinator." ".$officerresponsible." ".$dateInit." ".$ststus; $sql1 = "update userMaster set password = '$newPass' where username = '$username'"; //echo $sql1; $query1 = mysqli_query($con,$sql1 ) or mysqli_error(); $rowCount = mysqli_num_rows($query1); if($query1) { echo ""; echo ""; } //echo $sql2; } else { echo "No user with this username and password exists"; } } ?>