"OR" condition in db_select() I am studying the new database layer, and I am glad it is changed to an OOP layer. I need to implement a query with db_select(). I found I can add a WHERE statement with $query-&gt;condition(), but by default the conditions are AND'ed together.

How can I OR the conditions together?

$query=db_select('users','u')-&gt;fields('u',array('uid','title','created','uid'));
$query-&gt;join('flag_content','fc' , 'u.uid = fc.content_id');
$query-&gt;condition('fc.fid', '5' , '=');
$query-&gt;condition('fc.uid', $uid , '=');
//…
That's not correct, the default is AND. To use or, you need to use:

$or = db_or();
$or-&gt;condition();
$or-&gt;condition();
$query-&gt;condition($or);


But the main conditions on the query are definitely joined with AND.