Answer the question
In order to leave comments, you need to log in
How to pass parameters to DB:raw()?
How to pass parameters to this request?
Filter::select('*', \DB::raw("( SELECT COUNT(*) from filter_products
where product_id in ( select category_products.product_id from
category_products where category_products.category_id = '?'
group by category_products.product_id
) and filters.id = filter_products.filter_id
) as total ",[ $this -> category_id ]) )
Answer the question
In order to leave comments, you need to log in
Everything seems to be correct, the second parameter. What version of the framework?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question