Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

I think this could be a larger problem. If I back track into the /vendor/laravel/framework/src/Illuminate/Database/Connection.php when it hits the run command the query and the bindings appear to be ok.

So then it gets into $callback is where the issue must be coming from.

Last updated 2 years ago.
0

If I print out the last query using the \DB::getQueryLog() function. I return this:


array (size=3)
  'query' => string 'select * from `tracks` where `title` LIKE ? or `artist` LIKE ? and `id` not in (?, ?, ?, ?, ?) limit 10' (length=103)
  'bindings' => 
    array (size=7)
      0 => string '%Daft Punk%' (length=11)
      1 => string '%Daft Punk%' (length=11)
      2 => int 338
      3 => int 377
      4 => int 3343
      5 => int 1185
      6 => int 1532
  'time' => float 27.33

But in my laravel.log file it shows something different:

select * from `tracks` where `title` LIKE '%Daft Punk%' or `artist` LIKE '%Daft Punk%' and `id` not in ('%Daft Punk%', '%Daft Punk%', '%Daft Punk%', '%Daft Punk%', '%Daft Punk%') limit 10
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

whobutsb whobutsb Joined 20 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.