repositories
/
Project_webapp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Misc code cleanups and comment.
[Project_webapp.git]
/
lib
/
db.php
diff --git
a/lib/db.php
b/lib/db.php
index c7c2d48c71f9cb45e756b1151576b7e125e36c1a..bcbf5aebc2709265decce8a7d53ac86099f190f5 100644
(file)
--- a/
lib/db.php
+++ b/
lib/db.php
@@
-31,6
+31,9
@@
class CustomDB
return $this->connection;
}
return $this->connection;
}
+ /**
+ * [__destruct description]
+ */
/* public function __destruct()
{
$this->close();
/* public function __destruct()
{
$this->close();
@@
-80,6
+83,7
@@
class CustomDB
/**
* [prepared_query_bind_param description]
/**
* [prepared_query_bind_param description]
+ * @param [type] $types [description]
* @param [type] $params [description]
* @return [type] [description]
*/
* @param [type] $params [description]
* @return [type] [description]
*/
@@
-105,6
+109,10
@@
class CustomDB
return $rt_val;
}
return $rt_val;
}
+ /**
+ * [get_pquery_result description]
+ * @return [type] [description]
+ */
public function get_pquery_result()
{
$rt_val = $this->current_result = $this->current_stmt->get_result();
public function get_pquery_result()
{
$rt_val = $this->current_result = $this->current_stmt->get_result();
@@
-114,11
+122,24
@@
class CustomDB
return $rt_val;
}
return $rt_val;
}
+ /**
+ * [get_result_array description]
+ * @return [type] [description]
+ */
public function get_result_array()
{
public function get_result_array()
{
- $rt_val = $this->current_result->fetch_array();
- if (!$rt_val) {
+ $row = $this->current_result->fetch_array();
+ if (is_null($row)) {
+ $rt_val = [];
+ } elseif (!isset($row)) {
echo "Fail to build SQL query result array : (" . $this->current_stmt->errno . ") " . $this->current_stmt->error . " - " . $this->current_pquery . "<br>";
echo "Fail to build SQL query result array : (" . $this->current_stmt->errno . ") " . $this->current_stmt->error . " - " . $this->current_pquery . "<br>";
+ $rt_val = false;
+ } else {
+ $rows[] = $row;
+ while ($row = $this->current_result->fetch_array()) {
+ $rows[] = $row;
+ }
+ $rt_val = $rows;
}
return $rt_val;
}
}
return $rt_val;
}
@@
-136,4
+157,5
@@
class CustomDB
return $rt_val;
}
}
return $rt_val;
}
}
+
?>
?>