4
Good here in the stack I found some topics that helped me, I’m new with PHP, and I wanted to make my connection return a custom message without making it show those warnings.
Only when I add the check nothing happens, my complete 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;
}
}
?>
Thank you you answered my question correctly... it worked perfectly.
– Gabriel