aboutsummaryrefslogtreecommitdiff
path: root/models/database.php
diff options
context:
space:
mode:
Diffstat (limited to 'models/database.php')
-rw-r--r--models/database.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/models/database.php b/models/database.php
index 62f5b10..f472dbb 100644
--- a/models/database.php
+++ b/models/database.php
@@ -33,6 +33,13 @@ abstract class Table {
return $id;
}
+ static protected function _get_entries_count(string $table) : int {
+ $conn = Table::connect();
+ $query = $conn->query("SELECT count(*) FROM $table");
+ $conn = null;
+ return $query->fetchColumn();
+ }
+
static protected function _update(string $table, string $sets, string $identify) {
$conn = Table::connect();
$query = $conn->query("UPDATE $table SET $sets WHERE $identify");