From 63f714d5a78b765c117ebf6bbdfdbd748dd45644 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Thu, 4 May 2023 03:02:01 +0300 Subject: authentication; invitation; activation; base form setup --- core/classes/Database.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'core/classes/Database.php') diff --git a/core/classes/Database.php b/core/classes/Database.php index 8cac479..0a8a10a 100644 --- a/core/classes/Database.php +++ b/core/classes/Database.php @@ -14,6 +14,8 @@ class Database { private $result = null; + private $rowCount; + /** METHODS * ------------------------------------------------------------------------- @@ -78,6 +80,25 @@ class Database { } + + /** rowCount + * + * returns the number of affected rows from the last modification query + * (that inludes any of INSERT, UPDATE or DELETE; not the SELECT ones) + * + * NOTE: + * originally in php PDO driver, rowCount is applied onto the stamement; + * here it is applied onto the actual object, making the call much easier + * + * @param void; + * @return (int) : number of affected rows + */ + public function rowCount() + { + return $this->rowCount; + } + + /** query * --- * set and execute a query safely; @@ -103,6 +124,9 @@ class Database { } + // keep rowCount (valid for INSERT, UPDATE, DELETE) + $this->rowCount = $stmt->rowCount(); + $result = $stmt->fetchAll(PDO::FETCH_ASSOC); $this->result = $result; -- cgit v1.2.3