Assume I have an array:
$elements = array('foo', 'bar', 'tar', 'dar');
Then I want to build up a DELETE IN
SQL query:
$SQL = "DELETE FROM elements
WHERE id IN ('" . implode(',', $elements) . "')";
The problem is that the ids in the elements array aren't quoted each individually. I.E the query looks like:
$SQL = "DELETE FROM elements
WHERE id IN ('foo,bar,tar,dar');
What's the best, most elegants way to fix this?
nickb
then? Thanks. – Fellah