I am have trouble including files containing functions. I have a file called blog.php that runs the following:
<?php
require 'db.php';
require 'functions.php';
//Connect to the DB
$conn = Blog\DB\connect($config);
if ( !$conn ) die('Problem connecting to the db.');
The blog.php file is in the blog folder. Inside the blog folder is an admin folder containing an index.php file with the following code:
<?php
require '../blog.php';
This should allow me to call the blog.php which then calls the db.php file which contains my database connection functions but I am getting an error that the connect function is undefined . It's trying to require db.php from the blog>admin folder, not from where the blog.php file is located (which is the same directory as db.php)? How can I fix this?