創建用戶登錄日志表


    /**
     * 創建用戶登錄日志表
     * @param type $table
     * @return boolean
     */
    public function createUserLogin($table){
        if(!$table){
            return false;
        }
        $model = M();
        $s_table = "show tables like 'dz_". $table."'";  //查詢表是否存在
        $result = $model->query($s_table);
        if(empty($result)){
            $c_table = "CREATE TABLE `dz_".$table."` (
                `id` int(11) NOT NULL,
                `u_id` int(11) NOT NULL COMMENT '用戶id',
                `intro` varchar(50) DEFAULT '' COMMENT '描述',
                `add_date` int(11) NOT NULL DEFAULT '0' COMMENT '添加時間',
                `reg_date` int(11) NOT NULL DEFAULT '0' COMMENT '注冊時間',
                PRIMARY KEY (`id`)
              ) ENGINE=MyISAM  DEFAULT CHARSET=utf8;";
            $model->execute($c_table);
            return true;
        }
        return true;
    }

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM