let see.... this paragraph doesn't ring a bell for you? (
Disclaimer: I'm not trying to be rude or nothing similar... just trying to guide you in a different way)
The default character set and collation are latin1 and latin1_swedish_ci, so nonbinary string comparisons are case insensitive by default. This means that if you search with col_name LIKE 'a%', you get all column values that start with A or a. To make this search case sensitive, make sure that one of the operands has a case sensitive or binary collation. For example, if you are comparing a column and a string that both have the latin1 character set, you can use the COLLATE operator to cause either operand to have the latin1_general_cs or latin1_bin collation:
so...
step 1: Find your character set and
collation...
to find the collation:
step 2: Force one of the operands to have a case sensitive or binary collation... p.e (assuming that your collation is utf8_general_ci)
Code: Select all
if ($SQL = $mySQL->prepare("SELECT `username` FROM `students` WHERE `id_user` = ? AND `answ` = BINARY ? LIMIT 1")) or
if ($SQL = $mySQL->prepare("SELECT `username` FROM `students` WHERE `id_user` = ? AND LOWER(`answ`) = ? COLLATION utf8_bin LIMIT 1")) // assuming that your collation is utf8_general_ci