non information inserted in my database from my flutter app but the app run well

I've a problem in may flutter app that i made a PHP code to insert a user in my 00webhost database ,the app run well and return: {seccess register,1 }b ut non information inserted in my data base any help please

the PHP code is:

<?php
include "db.php";
      
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST');
header("Access-Control-Allow-Headers: X-Requested-With");
$name=$_POST['name'];
$email=$_POST['email'];
$pass=sha1($_POST['password']);
try {
    if (isset($name,$email,$pass)) {
        $req=$db->prepare("INSERT INTO users values(null,?,?,?)");
        $req->execute(array($nme,$email,$pass));
        if($req){
            $secces=1;
            $msg="seccess register";
        }else{
            $secces=0;
            $msg="error register";
        }
              
    }else{
        $secces=0;
        $msg="error Empty Data";
    }
} catch (\Throwable $th) {
    $msg ="error: ".$th ->getMessage();
  }
      
echo json_encode([
                     "result"=>[
                         $msg,
                         $secces
      
                         ]
                     ]);
?>

now in the code below it always show me this:{data: [email alredy excist, 0]} but there are nothing in the table user in my database:

<?php
include "db.php";
          
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST');
header("Access-Control-Allow-Headers: X-Requested-With");
$name=$_POST['name'];
$email=$_POST['email'];
$pass=sha1($_POST['password']);
try {
    if (isset($name,$email,$pass)) {
        $req=$db->prepare("SELECT * from users where email=?");
        $req->execute(array($email));
        $exist = $req->rowCount();
        if($exist=0){
            $req=$db->prepare("INSERT INTO users values(null,?,?,?)");
            $req->execute(array($nme,$email,$pass));
            if($req){
                $secces=1;
                $msg="seccess register";
            }else{
                $secces=0;
                $msg="error register";
            }
        }else{
            $secces=0;
            $msg="email alredy excist";
        }
    }else{
        $secces=0;
        $msg="error Empty Data";
    }
} catch (\Throwable $th) {
    $msg ="error: ".$th ->getMessage();
  }
          
echo json_encode([
                     "result"=>[
                         $msg,
                         $secces
          
                         ]
                     ])
    ?>
    ?>