try{ if ($db = mysqli_connect($hostname_db, $username_db, $password_db)) { //do something } else { throw new Exception('Unable to connect'); }}catch(Exception $e){ echo $e->getMessage();}
try{ if ($db = mysqli_connect($hostname_db, $username_db, $password_db)) { //do something } else { throw new Exception('Unable to connect'); }}catch(Exception $e){ echo $e->getMessage();}