Not loading my database


#1

![mk|690x392]


#2

Is it a wordpress website? :slight_smile:


#3

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


#5
<?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]);
}

#7

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


#10

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


#11

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.


#12

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


#13

Please Do Contact Us Anytime!


#14

Black Friday Sale 90% OFF
0
DAYS
0
HOURS
0
MINUTES
0
SECONDS
×