Hi Forum Members,
I've been struggling for some time on the above topic. I've tried everything I've read but
still can't get it to work in xampp. Can someone help me please.
Directories structure
C:xampp\htdocs\
The error I'm getting is as follows:
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\mysql_inc.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\index.php on line
And my code is as follows:
config.inc.php
//Base url constants declaration
define ('BASE_URI', 'C:\\xampp\htdocs\\');
define ('BASE_URL', 'localhost/');
define ('MYSQL', BASE_URI . 'mysql_inc.php');
//starting a session for the logins
session_start();
mysql.inc.php
<?php
//define constants for the db connection
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_USER', 'AMPONSAH');
DEFINE ('DB_PASSORD', 'password');
DEFINE ('DB_NAME', 'ecommerce1');
//connect to mysql
$dbc = mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
//----------------------------- MYSQL CONNECTION ------------------------------------------------------
//establish character set
mysqli_set_charset($dbc, 'utf8');