title: having trouble connecting to Database via config.php
body: <p>Trying to follow :</p>
  
  <p><a href="https://daveismyname.blog/blog/creating-a-blog-from-scratch-with-php" rel="nofollow noreferrer">David Carr's blog tutorial</a></p>
  
  <p>Reading down in comments at end of his tutorial you can see everyone having trouble creating a user for login. He explains the user and password is set
  within</p>
  
  <blockquote>
    <p>/includes/config.php</p>
  </blockquote>
  
  <p>It seems straightforward enough after creating the database and</p>
  
  <p>tables to input the username and password at top of configuration file :</p>
  
  <pre><code>&lt;?php
  ob_start();
  session_start();
  
   //database credentials
  define('DBHOST','localhost');
  define('DBUSER','foo');
  define('DBPASS','foo');
  define('DBNAME','foo');
  </code></pre>
  
  <p>But the login form fails. I tried checking permissions and ownership to see if that would help and initially when set up database I gave ownership to 
  user I am wanting to log in.</p>
  
  <p>Then I checked for the config.php form to be included in php form to login.</p>
  
  <p>Cannot work out what I am doing wrong within config.php form for adding user and password to effectively log in.</p>
  
  <p>NB:I have since worked this out. But as it is a painfully simple answer I will let others stuck figure it out.</p>
  
  <p>hint1/ You do not create user and password within mysql for login</p>
  
  <p>hint2/ the user and password is created in users.php</p>
  
  <p>hint3/ David Carr's simple php/mysql blog is perfect study where he's</p>
  
  <p>seamlessly included all you need in one folder and has given away</p>
  
  <p>the login at start of his tutorial! <em>doh</em></p>