I don't know exactly how to title this question, however I became aware of risks of SQL injection and I am modifying a query to use a prepared statement.
In the original query I was passing an array of ids to look for in the DB like this:
AND item.id IN ($ids)
where for example
$ids = "35,36,69,73,98,218,219,234,242";
Now I modified the query so I put that data into $params
like this:
$params = [':ids' => $ids ];
and modified the line in the query to:
AND item.id IN (:ids)
so I execute the query like this:
$query->execute($params);
However by dumping $query
I can see that the ids are not passed and this is what passes instead:
IN (:ids)
So obviously nothing is retrieved.