File Manager
Viewing File: connectdb.php
<?php
class Database
{
private $host = "localhost";
private $db_name = "heznutpr_bcb";
private $username = "heznutpr_bcb";
private $password = "JfR5pGedK70p";
public $conn;
public function dbConnection()
{
$this->conn = null;
$DB_con = null;
try {
$this->conn = new PDO("mysql:host=" . $this->host . ";dbname=" . $this->db_name, $this->username, $this->password);
$this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $exception) {
echo "Connection error: " . $exception->getMessage();
}
return $this->conn;
}
}
$connection = mysqli_connect('localhost', 'heznutpr_bcb', 'JfR5pGedK70p');
if (!$connection) {
die("Database Connection Failed" . mysqli_error($connection));
}
$select_db = mysqli_select_db($connection, 'heznutpr_bcb');
if (!$select_db) {
die("Database Selection Failed" . mysqli_error($connection));
}
$DB_host = "localhost";
$DB_user = "heznutpr_bcb";
$DB_pass = "JfR5pGedK70p";
$DB_name = "heznutpr_bcb";
try {
$DB_con = new PDO("mysql:host={$DB_host};dbname={$DB_name}", $DB_user, $DB_pass);
$DB_con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo $e->getMessage();
}
$select = "SELECT * FROM general_settings WHERE id='1'";
$result = mysqli_query($connection, $select) or die("could not select");
while ($row = mysqli_fetch_array($result)) {
$site_title = $row['site_title'];
$site_email = $row['site_email'];
$site_address = $row['site_address'];
$site_url = $row['site_url'];
$site_number = $row['site_number'];
$btc = $row['btc'];
$usdt = $row['usdt'];
$livechat_code = $row['livechat_code'];
$livechat_page = $row['livechat_page'];
$payment = $row['payment'];
// $image = $row['image'];
// $logowhite = $row['logowhite'];
// $favicon = $row['favicon'];
}