title: PHP How can I do multiple where conditions?
body: <p>This is my current code for taking a user log in:</p>
  
  <pre><code>&lt;?php
  $uName = "";
  $uNameMsg = "";
  $pWord = "";
  $pWordMsg = "";
  
  if(isset($_POST["submit"])){
      $uName = $_POST["username"];
      if (empty($uName)) {
          $uNameMsg = "please enter a username&lt;br/&gt;";
      }
  
      $pWord = $_POST["password"];
      if (empty($pWord)) {
          $pWordMsg = "please enter a password&lt;br/&gt;";
      }
  }
  
  ?&gt;
  
  //form goes here
  
  &lt;?php
      require_once("conn.php");
      $sql = "SELECT username, password FROM customers
              WHERE username = $uName 
              AND password = $pWord";
      $results = mysqli_query($conn, $sql)
      or die ('Problem with query' . mysqli_error($conn));
      if (mysqli_num_rows($results) &lt; 1) {
          echo "invalid username and password";
      } else {
          echo "query success, redirect header goes here";
      }
  ?&gt;
  </code></pre>
  
  <p>I get a syntax error saying that the 'AND password =' clause is wrong. and then it is saying that the error is located at line 3, my  tag, while the 'AND password ='is in line 75.</p>
  
  <p>this is the start of my code from line 1:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Customer Login&lt;/title&gt;
      &lt;link rel="stylesheet" href="customerlogin.css"&gt;
  &lt;/head&gt;
  </code></pre>