title: connection error in php from database
body: <p>I am getting this warning </p>
  
  <blockquote>
    <p>Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in C:\wamp\www\S_WEB\connection\dbcon.php on line 14`</p>
  </blockquote>
  
  <p>My table <code>users</code> is:<br>
  <img src="https://i.stack.imgur.com/h8ZfA.png" alt="table users with 0 rows"></p>
  
  <p>My code to query <code>user</code> is:</p>
  
  <pre><code>&lt;?php
  
       //Connect to database
  
        $servername = "127.0.0.1";
        $username = "root";
        $password = "root";
        $dbname = "s_web";
  
  // Create connection
  
  
  $db = mysqli_connect('127.0.0.1','root','root','s_web')
   or die('Error connecting to MySQL server.');
  
  
  
  $query = "SELECT * FROM user" ;
  mysqli_query($db, $query) or die('Error querying database');
  
  
  $result = mysqli_query($db, $query);
  $row = mysqli_fetch_array($result);
  
  while ($row = mysqli_fetch_array($result)) {
   echo $row['username'] . ' ' . $row['password'] . '&lt;br /&gt;';
  }
  
  ?&gt;
  </code></pre>
  
  <p>My question is that I am getting an error when I am trying to establishing a connection database using mysqli. 
  there I am getting many errors. last two days I am trying to fix my problem but I didn't.</p>