0

I have this code:

$this->db->query("SELECT category_id as id FROM categories__shops WHERE category_id IN (:id) AND shop_id = 2 ORDER BY manual_sort_index", [
            "id" => $superParentsIds
        ])->fetchAll();

For some reason it fetches only the first id from the superParentIds. If I use it this way:

$this->db->query("SELECT category_id as id FROM categories__shops WHERE category_id IN ($superParentsIds) AND shop_id = 2 ORDER BY manual_sort_index")->fetchAll();

It works properly and returns mutliple results. How should I prepare the $superParentsIds ?

EDIT: $superParentsIds is (10006,10007,10009,10008,11294,10010,10011,10050)

Toma Tomov
  • 1,476
  • 19
  • 55

0 Answers0