X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fdb.php;h=b548804c385f586ede81f6ac8f5c73f875d8dc92;hb=b5f60f89589412e18b51326378ab13b9a4fa0f19;hp=0f280a459e8efbdbeb55c0de5730481678b6cf9b;hpb=65fc0194b3ae059f212c577db4f4a8fec43069d6;p=Project_webapp.git
diff --git a/lib/db.php b/lib/db.php
index 0f280a4..b548804 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -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 . "
";
}
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 . "
";
}
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 . "
";
}
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 . "
";
}
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 . "
";
}
return $rt_val;
}