X-Git-Url: https://git.piment-noir.org/?p=Project_webapp.git;a=blobdiff_plain;f=lib%2Fdb.php;h=cd9b0825331a60c40b9c9a6d23590c487ffa8cd6;hp=c7c2d48c71f9cb45e756b1151576b7e125e36c1a;hb=33eb6f2ab954597a257e9eb8f793a9bc52dd9524;hpb=d5622f71ef49ac2313f5b98385bab231a9d64692 diff --git a/lib/db.php b/lib/db.php index c7c2d48..cd9b082 100644 --- a/lib/db.php +++ b/lib/db.php @@ -80,6 +80,7 @@ class CustomDB /** * [prepared_query_bind_param description] + * @param [type] $types [description] * @param [type] $params [description] * @return [type] [description] */ @@ -116,9 +117,18 @@ class CustomDB 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 . "
"; + $rt_val = false; + } else { + $rows[] = $row; + while ($row = $this->current_result->fetch_array()) { + $rows[] = $row; + } + $rt_val = $rows; } return $rt_val; } @@ -136,4 +146,5 @@ class CustomDB return $rt_val; } } + ?>