I am trying to write code using PHP to update column for specific user in phpmyadmin my code was work in localhost (xampp) but after I upload the back end on hostinger host it not work.
Here is my code:
<?php
include "../conect.php";
$username = filterRequest("username");
$verfiy = filterRequest("verifayCode");
$email = filterRequest("email");
$stmt = $con->prepare("SELECT * FROM users where username = '$username' AND verifayCode='$verfiy'");
$stmt->execute();
$count =$stmt->rowCount();
if($count > 0){
//$data = array("userApprove"=>"1");
$stmm = $con->prepare("UPDATE `users` SET `userApprove`=1 WHERE `email` = '$email' and `username` ='$username'");
$stmm->execute();
$c =$stmm->rowCount();
if($c>0){
echo json_encode(array("cont" => $c ));
echo json_encode(array("status" => "success"));
}else{
echo json_encode(array("cont" => $c ));
echo json_encode(array("status" => "faillo"));
}
}
else{
echo json_encode(array("cont" => $username,$count));
echo json_encode(array("status" => "faill"));
}
?>
This is the table in phpmyadmin:
Here the column information that answers will not change from 0 to 1:
My back end code work in locale host (xampp) but in hostinger host it not work the value of userApprove
column not update to 1.