Cita:
Iniciado por keypyhh
Código PHP:
Ver originalprotected function abrirConexion() {
try{
$this->conexion = new mysqli('localhost', 'root','root', 'latabla');
if (!$this->conexion) {
return false;
} else {
return true;
}
} catch (Exception $e){
return false;
}
}
¿Alguna manera de yo saber el error y retornar el false sin que se detenga la ejecución?
Implementando el try.. catch apropiadamente con mysqli_sql_exception: te dejo la liga a la documentación:
http://php.net/manual/en/class.mysqli-sql-exception.php