Notice: Use of undefined constant DB_HOST - assumed 'DB_HOST' in C:\xampp\htdocs\blog\system\functions.php on line 31
<p>Getting a couple of errors and can't for the life of me see where I am falling down. Below is the functions file</p>

<pre><code>&lt;?php
include('config.php');
function getAllPosts(){

try {

$dbh = new PDO(DB_HOST, DB_USER, DB_PASS);

} catch (PDOException $e){
echo $e-&gt;getMessage();
}

$stmt = $dbh-&gt;prepare('SELECT id, title, content FROM posts ORDER BY created_at DESC');

$stmt-&gt;execute();


$results = $stmt-&gt;fetchAll(PDO::FETCH_ASSOC);

return $results;


}

function getSinglePost($id){

try {

$dbh = new PDO(DB_HOST, DB_USER, DB_PASS);

} catch (PDOException $e){
echo $e-&gt;getMessage();
}

$stmt = $dbh-&gt;prepare('SELECT title, content FROM posts WHERE id = ?');

$bindings = array($id);

$stmt-&gt;execute($bindings);


$result = $stmt-&gt;fetch(PDO::FETCH_ASSOC);

return $result;


}


?&gt;
</code></pre>

<p>Also figured I should include the page that I am running to generate the error</p>

<pre><code>&lt;?php include('system/functions.php'); ?&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Create A New Post | My First Blog&lt;/title&gt;

&lt;link rel="stylesheet" type="text/css" href="style.css"&gt;

&lt;/head&gt;

&lt;body&gt;
&lt;div id="form"&gt;
&lt;?php if (isset($_GET['id'])){ ?&gt;

&lt;h2&gt;Single Post:&lt;/h2&gt;

&lt;?php $post = getSinglePost($_GET['id']); ?&gt;
&lt;?php print_r($post); ?&gt;

&lt;?php } ?&gt;
&lt;fieldset&gt;
&lt;/fieldset&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Any help much appreciated these are the errors in full.</p>

<p>Notice: Use of undefined constant DB_HOST - assumed 'DB_HOST' in C:\xampp\htdocs\blog\system\functions.php on line 31</p>

<p>Notice: Use of undefined constant DB_USER - assumed 'DB_USER' in C:\xampp\htdocs\blog\system\functions.php on line 31</p>

<p>Notice: Use of undefined constant DB_PASS - assumed 'DB_PASS' in C:\xampp\htdocs\blog\system\functions.php on line 31
invalid data source name
Notice: Undefined variable: dbh in C:\xampp\htdocs\blog\system\functions.php on line 37</p>

<p>Fatal error: Call to a member function prepare() on a non-object in C:\xampp\htdocs\blog\system\functions.php on line 37</p>

<p>Should include config file too</p>

<pre><code>&lt;?php
define('DB_HOST','mysql:host=localhost;dbname=blog');
define('DB_USER','root');
define('DB_PASS','');
?&gt;
</code></pre>
