I'm having this odd problem where I can store an email "test@gmail.com" into my DB that is either a varchar() or text() but I cannot select the row based off of the email. If I select the column via another identifier (say, a primary key called 'email_id') then I can display the email with the period in it. I can also select any row with email column with a varchar / text that does not have a period in it, such as "test@gmailcom".
I've replicated this on a test DB as well as my stage DB. This is also not a code issue because I've tested and replicated this when inserting directly into the DB from the query panel.
I've tried googling it but to no avail as well.
EDIT:
Am I using varchar() and/or text() correctly? Should it be something else? I've seen a few SO posts (cannot find them) stating to use VarChar.
For the record, I'm using mysql WorkBench for inserting / selecting, if that makes any difference.
EDIT 2:
Here are two records:
client_id (PK, AI, INT, UNSIGNED), email (varchar(500), not null)
in the table of client_login
.
client_id = 1, email = 'test@gmail.com'
and
client_id = 2, email = 'test@gmailcom'
The following select
select * from client_login where email='test@gmail.com'
returns 0 rows
select * from client_login where email='test@gmailcom'
returns 1 row
EDIT 3:
I can also do
select * from client_login where client_id=1
and it will show me the row where email = 'test@gmail.com'
, which is odd because it's as if the period is in the row but it's not actually a period...