title: MySQL Select AND OR
body: <p>I'm not having success with my query statement and I think it has to do with the way I'm executing it.</p>
  
  <pre><code>$query5 = "select * from ".$db_prefix."customer_det where (fname = '".$fname."' and lname = '".$lname."') or phone = '".$phone."'";
  </code></pre>
  
  <p>Essentially I want to select all from customer_det when the first and last name match the posted first and last name.  If there's no posted first and last name, then I want it to select all where the posted phone number matches.  My three variables $fname, $lname, and $phone are all set to read from the previous form $_POST['fname']; etc...</p>
  
  <p>Is this the right logic to be using?  </p>