Home > Backend Development > PHP Tutorial > 怎么判断文章的读取状态

怎么判断文章的读取状态

WBOY
Release: 2016-06-23 13:32:21
Original
1081 people have browsed it

请教一个问题:
我想用PHP做一个消息发布系统,数据库中有一个用户表和一个文章表,现在需要根据用户是否点击来判断某篇文章是否已读,我有3000多用户,如要要根据每个用户对一篇文章的读取状态来判断,那不是每篇文章得有3000多条数据,请教做这个系统的思路?


回复讨论(解决方案)

设一已读表,2 个字段:用户id 和 文章id
每当读取文章时,在此表中增加一条记录
凡不在此表的,就是未读

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template