title: Select by two values (AND), and if nothing will be found select by each (OR)
body: <p>I have MYSQL query:</p>
  
  <pre><code>$sql = "SELECT * FROM cities WHERE ";
  if ($city) { $where .= ($where ? " AND " : "")." ( city = '$city' ) "; }
  if ($street) { $where .= ($where ? " AND " : "")."( street = '$street'"); }
  
  if ($where) { 
    $sql .= $where;             
    $query = mysql_query($sql) or die(mysql_error($dbconnect_finder)); 
  }
  </code></pre>
  
  <p>I would like to build up this query, that if nothing will be found, it will use OR operator instead of AND. I know I can do query again, if there will be no resoults. To reduce costs, I would like to do it in one query.</p>
  
  <p>EDIT:
  When user will search for $city and $street, and will use $city = "Londan" (insteed of London), $street = "someStreet". AND operator will not work. Then OR operator should work. Is it possible to do it in one MYSQL query?</p>