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

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.

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.

Sign in to participate in this thread!


Your banner here too?

whobutsb whobutsb Joined 20 Feb 2014


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

Your logo here?

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

© 2024 - All rights reserved.