Welcome Guest, Not a member yet? Register   Sign In
SubQuery Not Working
#6

(01-17-2021, 05:43 PM)basahbasahan Wrote: May be it's too late. But you can use "use" in anonymous function if you want to access the variable outside the scope like this :

PHP Code:
$builder->orWhereIn("shop_id",function(BaseBuilder $builder) use ($crsk){
      return $builder->select('shop_id')->from('shops')->where('owner'$crsk);
}); 

No. The problem is that the hint of the BaseBuilder type is not specified correctly.
Expected

use CodeIgniter\Database\BaseBuilder;
Reply


Messages In This Thread
SubQuery Not Working - by louieuow - 10-28-2019, 03:31 PM
RE: SubQuery Not Working - by louieuow - 11-05-2019, 10:58 PM
RE: SubQuery Not Working - by dhefley - 05-10-2020, 06:45 AM
RE: SubQuery Not Working - by krishnamhnsingh - 05-31-2020, 07:37 PM
RE: SubQuery Not Working - by basahbasahan - 01-29-2021, 05:41 AM
RE: SubQuery Not Working - by paulbalandan - 01-30-2021, 09:33 AM
RE: SubQuery Not Working - by basahbasahan - 01-17-2021, 05:43 PM
RE: SubQuery Not Working - by iRedds - 01-18-2021, 07:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB