How do I use query conditions?
The code:

$res = db_select('table', 's')
-&gt;fields('s')
-&gt;condition('type', $type)
-&gt;condition('id', $id)
-&gt;execute()
-&gt;fetch();


is not faulty in itself. The problem is probably that you don't have a record with matches both id and type. If you want to make an or query, you need to use db_or