So in this case I am working with laravel but it might just be a MySQL “issue”. I have a simple database table with only a name
field that has two records:
1: B-Front
2: Frontliner
I have a string called: “B-Frontliner”
I am trying to get the results from the database, based on my string. In my opinion, I should get both results from my database with the following query:
$results = Artist::where(‘name’, ‘LIKE’, ‘%’ . $string . ‘%’)->get();
But I am not getting any results. Even with using strtolower
etc, no results. Also not when simply putting everything in lowercase manually, for testing purposes.
Am I simply understanding this all wrong or is my query simply wrong?