From 03dcc7e0e06e92924c28af0881b2c060156a154f Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sun, 20 Jun 2021 11:15:43 +0200 Subject: [PATCH] If database connx failed then reload the form --- html/install.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/html/install.php b/html/install.php index ba2e56598..72fabbcc5 100644 --- a/html/install.php +++ b/html/install.php @@ -252,11 +252,16 @@ if (isset($_POST['save_config'])) { } // Try to connect , if it doesn't work that do not create the config file - if ($multi=="N") { - $cnx = new DatabaseCore($db_user, $db_password,'template1', $db_host, $db_port); - }else { - $cnx = new DatabaseCore($db_user, $db_password,$db_name, $db_host, $db_port); - } + try { + if ($multi=="N") { + $cnx = new DatabaseCore($db_user, $db_password,'template1', $db_host, $db_port); + }else { + $cnx = new DatabaseCore($db_user, $db_password,$db_name, $db_host, $db_port); + } + + } catch (Exception $ex) { + $cnx=false; + } // ----- // If conx successfull save the file or display it // -----