title: Confusion with the use of logical operators in MySql
body: <p>I have a table called <code>users</code> as below :</p>
  
  <p><a href="https://i.stack.imgur.com/7Sygk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Sygk.png" alt="enter image description here"></a></p>
  
  <p>Now when I run a query as :</p>
  
  <pre><code>select * from users where name='admin1' AND 1;
  </code></pre>
  
  <p>I get as output only the <code>admin1</code> record as shown below:
  <a href="https://i.stack.imgur.com/Xkel1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Xkel1.png" alt="enter image description here"></a></p>
  
  <p>While with the query as:</p>
  
  <pre><code>select * from users where name='admin1' OR 1;
  </code></pre>
  
  <p>I get as output all the records as shown below:
  <a href="https://i.stack.imgur.com/3IIF3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3IIF3.png" alt="enter image description here"></a></p>
  
  <p>I am trying to understand why is this happening. IMHO, if we are talking of evaluating the logical expression, both the queries above evaluate to 1 as they are both </p>
  
  <blockquote>
    <p>1 AND 1</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>1 OR 1</p>
  </blockquote>
  
  <p>So why this difference ? Or is there something fundamental that I am perhaps missing ?</p>