db_select with 'OR' condition

Public

How to use 'OR' between conditions as default uses 'AND'

Get raw version
php
  1. $query=db_select('users','u');
  2. $query->fields('u', array('fname');
  3.  
  4. $db_or = db_or();
  5. $db_or->condition('u.lname', 'xyz' , '=');
  6. $db_or->condition('u.status', 1 , '=');
  7. $query->condition($db_or);
  8.  
  9. $result = $query->execute()->fetchAll();