title: Can't connect to database with 000webhost
body: <p>I'm trying to learn php but when I attempt to connect to a mysql database, I get this error. I don't think anything is wrong with the code itself but perhaps there is an error on the hosts side? I'm using 000webhost so.</p>
  
  <blockquote>
    <p>Warning: mysqli::mysqli() [mysqli.mysqli]: (28000/1045): Access denied
    for user 'a7976620_db1user'@'localhost' (using password: YES) in
    /home/a7976620/public_html/index.php on line 17</p>
  </blockquote>
  
  <p>Here is my php:</p>
  
  <pre><code>&lt;?php
  
  $servername = "localhost";
  $username = "a7976620_db1user";
  $password = "******";
  
  // Create connection
  $conn = new mysqli($servername, $username, $password);
  
  // Check connection
  if ($conn-&gt;connect_error) {
  die("Connection failed: " . $conn-&gt;connect_error);
  }
  echo "Connected successfully";
  ?&gt; 
  </code></pre>