我无法解决此问题。 我看到错误
- 警告:mysqli_connect拒绝用户'assamcre_deep'@'%'访问数据库
中的数据库“ assamcre_pubg”- 警告:mysqli_close()期望参数1为mysqli,在第47行的/home/assamcre/public_html/battleworld/data/db_connect.php中给出的布尔值
<?php
/**
* A class file to connect to database
*/
class DB_CONNECT
{
public $con;
// constructor
function __construct()
{
// connecting to database
$this->connect();
}
// destructor
function __destruct()
{
// closing db connection
$this->close();
}
/**
* Function to connect with database
*/
function connect()
{
// import database connection variables
require_once __DIR__ . '/db_config.php';
global $con;
// Connecting to mysql database
$con = mysqli_connect(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE) or die(mysql_error());
// Selecing database
// $db = mysqli_select_db(DB_DATABASE) or die(mysql_error()) or die(mysql_error());
// returing connection cursor
return $con;
}
/**
* Function to close db connection
*/
function close()
{
global $con;
// closing db connection
mysqli_close($con);
}
}