You need to remove the unique
index from the password
and rather add it to users
I have tried making the password column unique, still doing the same thing. Any ideas?
this is the reason why you are getting this error message Duplicate entry for key
From your schema Remove this lines
UNIQUE KEY password_2 (password),
UNIQUE KEY password_3 (password),
UNIQUE KEY password_4 (password),
UNIQUE KEY password_5 (password),
your new schema will look like
CREATE TABLE admin (
id int(16) NOT NULL AUTO_INCREMENT,
email varchar(32) NOT NULL,
firstName varchar(32) NOT NULL,
lastName varchar(32) NOT NULL,
password varchar(32) NOT NULL,
DateOfBirth date NOT NULL,
Gender char(1) NOT NULL,
phoneNumber varchar(50) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY email (email),
KEY phoneNumber (phoneNumber)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1