From 93d4fafcf253b7646172fff5e4798a80773aff3f Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 30 Mar 2010 12:12:22 -0300 Subject: Implementing MaleteDb::rows() --- classes/MaleteDb.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'classes/MaleteDb.php') diff --git a/classes/MaleteDb.php b/classes/MaleteDb.php index 9e8684f..fd10c78 100644 --- a/classes/MaleteDb.php +++ b/classes/MaleteDb.php @@ -28,11 +28,21 @@ class MaleteDb implements IsisDb { if (!is_numeric($id)) { return FALSE; } - $results = $this->db->read($id); - return $this->tag($results); + if ($results !== FALSE) { + $results = $this->db->read($id); + return $this->tag($results); + } + else { + return FALSE; + } } public function rows() { + $id = 1; + while($this->db->read($id)) { + $id++; + } + return $id - 1; } public function default_schema() { -- cgit v1.2.3