Well here in the stack I found some topics that helped me, I'm new to PHP, and wanted to make my connection return a custom message without making it show those warnings .
But when I add verification nothing happens, my full code below.
<?php
class Connect {
private $Connect;
public function Connect() {
$this->Connection();
if(connection_aborted() == TRUE) {
$this->Connection();
}
}
public function Connection() {
global $Config;
$this->Connect = new mysqli($Config['mysql']['hostname'], $Config['mysql']['username'], $Config['mysql']['password'], $Config['mysql']['database'], $Config['mysql']['dataport']);
if($this->Connect == false){
exit('Falha na conexão, verifique Config.php');
}
return false;
}
}
?>