0

I have used Join query,in which i'm able to fetch only one row by below query where $productId = 10

$collection->getSelect()->where('paproduct.product_id = (?)', $productId);

I want to use multiple $productId in array (May be with LIKE operator). How can i do it?

$collection->getSelect()->where('paproduct.product_id LIKE ?', $productId);
2

Use IN instead LIKE. For example:


$collection->getSelect()->where('paproduct.product_id IN (?)', $productId);

$productId should be array. Like:


$productId = [1,2];
  • It's so simple, why I dont know this? – Ketan Borada Jan 9 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.