|MySQL better approach to check duplicate entry|
Here are my answers:
Is 2nd approach better for duplicate entry prevention?
yes, in my opinion second approach is better, if you know that
userid is going to be always unique, you should make it a
MySQL will automatically handle
Are 2nd & 3rd approach same or different?
I think both are same and
MySQL throws error in these
Is there still any better approach to prevent duplicate entry with
minimum DB Query?
You can put
UNIQUE INDEX on this column, that will be