noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 33/46: If database connx failed then reload t


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 33/46: If database connx failed then reload the form
Date: Tue, 13 Jul 2021 05:01:59 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 03dcc7e0e06e92924c28af0881b2c060156a154f
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sun Jun 20 11:15:43 2021 +0200

    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 ba2e565..72fabbc 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
   // -----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]