diff --git a/core/trunk/core/class/class_db.php b/core/trunk/core/class/class_db.php
index 2fb5409b80500fd7ea06ade743e2fe83aab3fb0a..732440dd491e693aa81703f5d5f781531dd73431 100644
--- a/core/trunk/core/class/class_db.php
+++ b/core/trunk/core/class/class_db.php
@@ -521,8 +521,8 @@ class dbquery extends functions
         // Connexion error
         if ($this->_sqlError == 1) {
             // Shows the connexion data (server, port, user, pass)
-            echo '- <b>' . _DB_CONNEXION_ERROR . '</b>';
             if ($_SESSION['config']['debug'] == 'true') {
+                echo '- <b>' . _DB_CONNEXION_ERROR . '</b>';
                 echo ' -<br /><br />' . _DATABASE_SERVER . ' : '
                     . $this->_server . '<br/>' . _DB_PORT . ' : ' . $this->_port
                     . '<br/>' . _DB_TYPE . ' : ' . $this->_databasetype
@@ -530,6 +530,7 @@ class dbquery extends functions
                     . _DB_USER . ' : ' . $this->_user . '<br/>' . _PASSWORD
                     . ' : ' . $this->_password;
             }
+            header("HTTP/1.0 500 Internal Server Error");
             exit();
         }
 
@@ -619,4 +620,4 @@ class dbquery extends functions
         }
 
     }
-}
\ No newline at end of file
+}