<p>I have an SQL query that takes the following form:</p>

<pre><code>UPDATE foo
SET flag=true
WHERE id=?
</code></pre>

<p>I also have a PHP array which has a list of IDs. What is the best way to accomplish this other than with parsing, as follows, ...</p>

<pre><code>foreach($list as $item){  
    $querycondition = $querycondition . " OR " . $item;  
}
</code></pre>

<p>... and using the output in the <code>WHERE</code> clause?</p>

You should be able to use the IN clause (assuming your database supports it):
```
UPDATE foo
SET flag=true
WHERE id in (1, 2, 3, 5, 6)
```