I am trying to make my login database better. I am currently thinking about case sensitivity. I’ve spent two hours researching this subject. I think that i have a grip on the matter but i don’t know if the information is accurate. So in order to enforce case sensitivity for a username, i add a collation?
CREATE DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_cs;
so this collation (utf8mb4_unicode_cs) will automatically void john where i am looking for John? or do i still need to use a BINARY command?
select * from users where **binary** username = '$username'
from what i understand, LIKE allows ci comparison.
is this correct? thus my database now looks like the following:
CREATE DATABASE user_accounts CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_cs;
create table user_login(id int(11) not null unsigned auto_increment primary key, username varchar(255) not null unique key, password varchar(255) not null);
I don’t know why tutorials do not address these issues. Everyone just writes “create database users;” and finish with “now you have a login database.” SO much info is not mentioned. I always have to spend hours, days, weeks, months or years to learn how to do something properly. Very frustrating.