I am trying to execute the following code:
$state = db_select('webform_email_confirm', 'wec')
->fields('wec')
->condition('nid', $form['nid']['#value'], '=')
->condition('cid1', $form['cid']['#value'], '=')
->or('cid2', $form['cid']['#value'], '=')
->execute()
->fetchAssoc();
The third statement, ->or('cid2', $form['cid']['#value'], '='), does not work.
I need to match records in my database in either cid1 or cid2.
You would have to use the db_or(), or the $query->where constructs.
Please have a look at this page for more information.
So basically, try:
The examples on the drupal website may be useful too: