title: Access denied for user 'my_user'@'localhost' (using password: YES)
body: <p>Can someone explain what this means and what I can do to fix it? </p>
  
  <p>The error: </p>
  
  <blockquote>
    <p>Access denied for user 'my_user'@'localhost' (using password: YES)</p>
  </blockquote>
  
  <p>My php file:</p>
  
  <pre><code>&lt;?php
      $mysqli = new mysqli("localhost", "my_user", "my_password", "my_db");
  
      $password = $_POST["password"];
      $username = $_POST["username"];
  
      $statement = mysqli_prepare(mysqli, "SELECT * FROM User WHERE username = ? AND password = ?");
      mysqli_stmt_bind_param($statement, "ss", $username, $password);
      mysqli_stmt_execute($statement);
  
      mysqli_stmt_store_result($statement);
      mysqli_stmt_bind_result($statement, $userID, $name, $age, $username, $password);
  
      $user = array();
  
      while(mysqli_stmt_fetch($statement)){
      $user[name] = $name;
      $user[age] = $age;
      $user[username] = $username;
      $user[password] = $password;
      }
  
      echo json_encode($user);
      mysqli_stmt_close($statement);
  
  
      mysqli_close(mysqli);
  
  ?&gt;
  </code></pre>