title: How do I read values from config.php file to another file
body: <p>I am new to coding with php and I need help with this.</p>
  
  <p>I have a config.php file with these values</p>
  
  <pre><code>&lt;?php
   define('DATABASE_HOST', 'localhost');
   define('DATABASE_NAME', 'voltrun');
   define('DATABASE_USERNAME', 'joy');
   define('DATABASE_PASSWORD', 'salty');
   ?&gt;
  </code></pre>
  
  <p>I have also a db.php file with these values</p>
  
  <pre><code>&lt;?php require_once"../config.php";
   echo 'DATABASE_HOST';
   echo 'DATABASE_NAME';
   echo 'DATABASE_USERNAME';
   echo 'DATABASE_PASSWORD'
  
    $db_host = 'DATABASE_HOST';
    $db_user = 'DATABASE_USERNAME';
    $db_password =  'DATABASE_PASSWORD';
    $db_database = 'DATABASE_NAME';
  
     $connection = mysqli_connect($db_host, $db_user, $db_password,    $db_database);
  
        if (!$connection) {
  die('QUERY FAILED' . mysqli_error($connection));
     } 
  
  
     ?&gt;
  </code></pre>
  
  <p>Any help on how to get the parameters from the config.php file into the db.php variables? As I still get Query Failed error.</p>
  
  <p>Thanks for the help. </p>