Tidy a bit the files structure.
[Project_webapp.git] / lib / db.php
index 0f280a459e8efbdbeb55c0de5730481678b6cf9b..b548804c385f586ede81f6ac8f5c73f875d8dc92 100644 (file)
@@ -52,7 +52,7 @@ class CustomDB
     public function query($sql_query)
     {
         if ($this->connected && !($query_result = $this->connection->query($sql_query))) {
-            echo "Fail to execute the SQL query : " . $sql_query;
+            echo "Fail to execute the SQL query : " . $sql_query . "<br>";
         }
         return $query_result;
     }
@@ -68,7 +68,7 @@ class CustomDB
         if ($this->connected && !($this->current_stmt = $this->connection->prepare($this->current_pquery))) {
             // Empty the currently stored prepared query in the failure case
             $this->current_pquery = "";
-            echo "Fail to prepare SQL query : (" . $this->connection->errno . ") " . $this->connection->error . " - " . $this->current_pquery;
+            echo "Fail to prepare SQL query : (" . $this->connection->errno . ") " . $this->connection->error . " - " . $this->current_pquery . "<br>";
         }
         return $this->current_stmt;
     }
@@ -80,9 +80,10 @@ class CustomDB
      */
     public function prepared_query_bind_param(...$params)
     {
+        var_dump($params);
         $rt_val = $this->current_stmt->bind_param($params);
         if (!$rt_val) {
-            echo "Fail to link parameters to SQL query : (" . $this->current_stmt->errno . ") " . $this->current_stmt->error . " - " . $this->current_pquery;
+            echo "Fail to link parameters to SQL query : (" . $this->current_stmt->errno . ") " . $this->current_stmt->error . " - " . $this->current_pquery . "<br>";
         }
         return $rt_val;
     }
@@ -95,7 +96,7 @@ class CustomDB
     {
         $rt_val = $this->current_stmt->execute();
         if (!$rt_val) {
-            echo "Fail to execute SQL query : (" . $this->current_stmt->errno . ") " . $this->current_stmt->error . " - " . $this->current_pquery;
+            echo "Fail to execute SQL query : (" . $this->current_stmt->errno . ") " . $this->current_stmt->error . " - " . $this->current_pquery . "<br>";
         }
         return $rt_val;
     }
@@ -108,7 +109,7 @@ class CustomDB
     {
         $rt_val = $this->current_stmt->close();
         if (!$rt_val) {
-            echo "Fail to close SQL query : (" . $this->current_stmt->errno . ") " . $this->current_stmt->error . " - " . $this->current_pquery;
+            echo "Fail to close SQL query : (" . $this->current_stmt->errno . ") " . $this->current_stmt->error . " - " . $this->current_pquery . "<br>";
         }
         return $rt_val;
     }