Hi. I perform $a = Items::where('code', '=', $code);
In the code column there are various entries, uniques and alphanumerics...
There are Asj7yd and Asj7yD As you see they are 2 DIFFERENT codes as the last letter is a d in first case and D in the second.
The count of the result of the query gives 2. WHYYYYYYY???
How do i make laravel CASE SENSITIVE for the queries it performs???
I need a global solution to implement and resolve this stupid problem. PLEASE HELP!
That's probably MySQL rather than Laravel
You'll need to write a raw SQL command like:
$a = Items::whereRaw("BINARY code = '$code' ");
When I write my pure PHP code and perform queries i had never before met this problem. Maybe by luck. But how can i solve without putting this on every query? Can i change any MAIN LARAVEL FILE so that this happens ALWAYS by default???
I found a solution. In the config file, wher the mysql configuration I put utf8_bin instead of unicode_ci and reset migrations.
Now it performs the queries correctly
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community