My php has connected to my database however when I try to insert the data, I get the query is not okay response.

```
if(isset($_POST['Register'])) {

    session_start();
    $FName = $_POST['First_Name'];  
    $LName = $_POST['Last_Name'];
    $Email = $_POST['Email'];
    $PW = $_POST['Password'];   

    $query = "INSERT INTO user (Fname, Lname, Email, Password) VALUES('{$FName}', '{$LName}', '{$Email}', '{$PW}')";
    $result=mysqli_query($con, $query);
    if($result){
        echo "Query is successfully executed";
    }else{
        echo "Query is not ok";
 }
    }

?>

```

This is my connection code but it tells me that I am successfully connected.

```
$con = mysqli_connect("localhost", "*******","*******");
mysqli_select_db('batman',$con);

if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
} 
echo "Connected successfully";
?>

```

The database matches all of the inputs and the table name is user so I cannot figure out why it will not insert into the database.