Not loading my database

![mk|690x392]

Is it a wordpress website? :slight_smile:

1 Like

You have a path error somewhere in your code or configuration. public_html.. should not have two dots in it.

2 Likes
<?php
$db = mysqli_connect('localhost','id4928270_chamila','0715807081','id4928270_buyit');
if(mysqli_connect_errno()){
	echo 'Database connection faild following errors'.mysqli_connect_error();
	die();
}
session_start();
require_once $_SERVER['DOCUMENT_ROOT'].'/storage/ssd2/270/4928270/public_html../config.php';
require_once BASEURL. '../helpers/helpers.php';

$cart_id = '';
if(isset($_COOKIE[CART_COOKIE])){
	$cart_id = sanitize($_COOKIE[CART_COOKIE]);
}

^ Code formatting please. Click the edit button, select all text, click the code icon in the toolbar.

1 Like

Code reformatted, you can now look at it :slight_smile:

1 Like

Use this code

<?php
$db = mysqli_connect('localhost','id4928270_chamila','0715807081','id4928270_buyit');
if(mysqli_connect_errno()){
	echo 'Database connection faild following errors'.mysqli_connect_error();
	die();
}
session_start();
require_once ('./config.php');
require_once ('./helpers/helpers.php');

$cart_id = '';
if(isset($_COOKIE[CART_COOKIE])){
	$cart_id = sanitize($_COOKIE[CART_COOKIE]);
}

No need to use document root, just use the simple paths.

1 Like

Thank you, Now my web site loading :hugs::hugs::hugs::hugs::hugs:

1 Like

Please Do Contact Us Anytime!

1 Like