$this->db_result = pg_exec ($this->db_connection, $inp_sql_query);
$this->db_row_number = 0;
+ return $this->db_result;
}
function fetch_row() {
}
}
- function num_rows() {
+ function fetch_object($result, $row)
+ {
+ return pg_fetch_object($result, $row);
+ }
+
+ function num_rows($db_result = 0) {
/* This functions returns the number of rows in a resultset
- * INPUT : NONE
+ * INPUT : Postgres result index (default = internal result)..
* OUTPUT : Number of rows (number)
*/
- return pg_numrows($this->db_result);
+
+ if ($db_result == 0)
+ {
+ // Default: use result from inside the object.
+
+ $db_result = $this->db_result;
+ }
+ return pg_numrows($db_result);
+
// 4.2.X return pg_num_rows($this->db_result);
}