I am working through the Build Database Driven Website with PHP and Mysql by Kevin Yank edition 4.
I am having a problem connecting to my ijdb database when I use: include $SERVER['DOCUMENTROOT'] . '/includes/db.inc.php'; I am able to connect to the database when I don't use the include but have the connection code in my controller file. So the issue is with the $SERVER['DOCUMENTROOT'] which doesn't seem to work?
In the actual db.inc.php, I have ensured the connection details are correct: $link = mysqli_connect('127.0.0.1', '*****', '*******');
So is there any reasons why include $SERVER['DOCUMENTROOT'] won't work? Do I need to specify something in a php config file or something?