diff --git a/core/trunk/core/class/class_db.php b/core/trunk/core/class/class_db.php
index 732440dd491e693aa81703f5d5f781531dd73431..41e36e38192da9e40363731256504fd8eb6a62fe 100644
--- a/core/trunk/core/class/class_db.php
+++ b/core/trunk/core/class/class_db.php
@@ -521,6 +521,7 @@ class dbquery extends functions
         // Connexion error
         if ($this->_sqlError == 1) {
             // Shows the connexion data (server, port, user, pass)
+            header("HTTP/1.0 500 Internal Server Error");
             if ($_SESSION['config']['debug'] == 'true') {
                 echo '- <b>' . _DB_CONNEXION_ERROR . '</b>';
                 echo ' -<br /><br />' . _DATABASE_SERVER . ' : '
@@ -530,7 +531,6 @@ class dbquery extends functions
                     . _DB_USER . ' : ' . $this->_user . '<br/>' . _PASSWORD
                     . ' : ' . $this->_password;
             }
-            header("HTTP/1.0 500 Internal Server Error");
             exit();
         }