You should provide us a snippet of your registration code.
Are you setting the id inside the array?
If you are, try to remove that line.
Also, try using the modern array syntax instead of the older one. You can just use brackets [ .. ] instead of array( .. ) the old syntax should be avoided in new PHP applications.
<?php require_once 'connection.php'; ?>
<?php require_once 'library.php'; ?>
<?php
if(chkLogin()){
header("Location: home.php");
}
?>
<?php
if(isset($_POST['reg'])){
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$temp = $_POST['pass'];
$options = array('cost' => 10);
$pass = password_hash($temp, PASSWORD_BCRYPT, $options);
$arrays = array(
"accountName" => $fname,
"email" => $fname,
"password" => $pass,
"pin" => $lname
);
$query = chkemail($email);
if($query){
register($arrays);
header("Location: login.php");
}
else{
echo "Email already registered!";
echo"<br>";
echo "Please <a href='register.php'>Register</a> with another email ID";
}
}
?>