How to implement points system in PHP forum

Guanhui
Release: 2023-03-01 08:50:01
Original
3859 people have browsed it

How to implement points system in PHP forum

How to implement the points system in PHP forum

First define a points field in the user table; then create a rating table whose main fields are Level name, upper limit points and lower limit points; then accumulate points according to the user's behavior; and finally determine which level range the user's points are in, thereby obtaining the user level.

User Table

CREATE TABLE `bbs`.`user` ( `id` INT(10) UNSIGNED NOT NULL COMMENT 'UID' , `avatar` VARCHAR(255) NOT NULL COMMENT '头像' , `nickname` VARCHAR(60) NOT NULL COMMENT '昵称' , `username` VARCHAR(16) NOT NULL COMMENT '用户名' , `password` CHAR(32) NOT NULL COMMENT '密码' , `points` INT(10) NOT NULL DEFAULT '0' COMMENT '积分' , PRIMARY KEY (`id`) ) ENGINE = MyISAM;
Copy after login

Level Table

CREATE TABLE `bbs`.`level` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID' , `name` VARCHAR(60) NOT NULL COMMENT '等级名' , `top_points` INT(10) UNSIGNED NOT NULL COMMENT '上限积分' , `down_points` INT(10) UNSIGNED NOT NULL COMMENT '下限积分' , PRIMARY KEY (`id`) ) ENGINE = MyISAM;
Copy after login

Recommended tutorial: "PHP Tutorial"

The above is the detailed content of How to implement points system in PHP forum. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!