瀏覽代碼

add stats

andre 4 年之前
父節點
當前提交
4d7c76c0f5
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      stats.php

+ 5 - 0
stats.php

@@ -1,6 +1,11 @@
 <?php
 <?php
 
 
 class stats {
 class stats {
+
+    public function __construct() {
+        $this->db = new db();
+    }
+
     public function log($ip,$action,$token) {
     public function log($ip,$action,$token) {
         $dbAction = $this->db->prepare("INSERT IGNORE INTO stats ('ip','action','token') VALUES (?,?,?)");
         $dbAction = $this->db->prepare("INSERT IGNORE INTO stats ('ip','action','token') VALUES (?,?,?)");
         $dbAction->bind_param('iss',$ip,$action,$token);
         $dbAction->bind_param('iss',$ip,$action,$token);