i want to access $mysqli from db_connect.db in my class
db_connect.php
<?php
include_once("db.php");
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
mysqli_set_charset($mysqli,"utf8");
?>
class.php
class class{
function __construct() {
include_once 'db_connect.php';
}
function get()
{
if (!$mysqli->connect_errno) {
}
}
}
i can access $mysqli if i include the db_connect.php directly in a php function without a class
edit and i want to access $mysqli in all functions of the class
thanks