mysql - 数据状态与时间问题
迷茫
迷茫 2017-04-17 11:50:34
0
1
438
CREATE TABLE `article` (
    `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    `title` VARCHAR(200) NOT NULL COMMENT '标题',
    `details` TEXT NOT NULL COMMENT '详细',
    `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态,1发布,2审核通过,3,4,5,6,7,8',
    PRIMARY KEY (`id`)
);

这是表,要记录第个状态发生的时间,怎么处理
比如:状态1,什么时间发生,状态2,什么时间发生

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
黄舟

Generally when creating a table, a ctime and an mtime will be given to represent the record creation time and the last modification time. In your case, I don’t know if adding a field to mark the status from what time to what time will satisfy you. In addition, there are also One way is to add an additional log table to record

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!