diff options
author | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2016-08-28 10:04:31 +0200 |
---|---|---|
committer | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2016-08-28 10:04:31 +0200 |
commit | 116706ea073b92d14497658fd35a1fef3760f750 (patch) | |
tree | bfe79846d58d7204c8ede79d5060198ead674fa8 | |
parent | 9be711a48e9ddff5e95987abe1c9bfc3c393a62a (diff) | |
download | chd_gestion-116706ea073b92d14497658fd35a1fef3760f750.zip chd_gestion-116706ea073b92d14497658fd35a1fef3760f750.tar.gz chd_gestion-116706ea073b92d14497658fd35a1fef3760f750.tar.bz2 |
Print error on mysql connection failure and bail out.
-rw-r--r-- | api/gen_conf.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/api/gen_conf.php b/api/gen_conf.php index f6a1019..39e54a3 100644 --- a/api/gen_conf.php +++ b/api/gen_conf.php @@ -21,6 +21,9 @@ include_once('inc/config.php'); $mysqli = new mysqli($db_config['host'], $db_config['username'], $db_config['password'], $db_config['database']); +if (mysqli_connect_errno()) { + die(mysqli_connect_error()); +} unset($db_config); $mysqli->query("SET NAMES 'utf8'"); |