connection error in php from databse : i am getting this warning 
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` 
my code is 
<?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'] . '<br />';
}

?>`


i am new to php and mysqli. and 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.
sorry my English is not good.     

 