Soy un poco novato en esto asi que perdonen la pregunta. Porque en la funcion "disconnect", al hacer un llamado a la funcion close() (de mysqli) no responde?
Código (php-brief) [Seleccionar]
class DBConnection {
private $connection;
// On instance created connect to db
public function __construct() {
$this->connect();
}
private function connect() {
require_once 'db_config.php';
$this->connection = @new mysqli(DB_HOST, DB_USER, DB_PASSWORD);
if(!$this->connection)
die('Couldnt connect to db: ' . $this->connection->connect_error);
}
private function disconnect() {
$this->connection->close();
}
public function __destruct() {
// Check if connection was established
if($this->connection != NULL) {
$this->disconnect();
}
}
}