user_table | |
id | name |
---|---|
1 | Eshin |
2 | Jozer |
3 | W3schools100 |
We have to use MySql function
BINARY
in where clause to perform case sensitive querying. The MySql example is,
SELECT * FROM 'user_table' WHERE BINARY 'username' = 'W3schools100';
So how we do in Laravel
We have to add
DB::raw()
raw query to make case sensitive query. For example
DB::table('user_table')->where(DB::raw("BINARY `username`"),'W3schools100')->get();
or
DB::table('user_table')->whereRaw("BINARY `username` = 'W3schools100'")->get();
Laravel Development Company, Get a free quote for laravel web development requirement from a leading Laravel Development Company. Discuss your web project with us to get large discounts...Contact us:+91-9806724185 or Contact@expresstechsoftwares.com
ReplyDelete