This my table:
customer_id
user_id
password
email
first_name
last_name
My primary key is customer_id
which is generated by the system. How can I prevent a user form creating multiple accounts?
Should I put a constrain on another column?
This my table:
customer_id
user_id
password
email
first_name
last_name
My primary key is customer_id
which is generated by the system. How can I prevent a user form creating multiple accounts?
Should I put a constrain on another column?
Create a unique index or constraint on however you identify the user. I'm not sure which columns you have in mind, but this would be typical:
alter table mytable add constraint unq_table_email unique (email);
You can have more than one unique constraint on the table.
Here you don't have a username field so u can do is that you can make email field as unique. What I do is that I make email id unique and whenever user tries to register i check whether email id is present. Because email id is unique no two person can have same email id.