改写和替换:一个关于ASP编程的问题.

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 17:06:06
我有个格子网站,我想实现下面的功能,就是发布格子有时间限制,一个格子只能显示1个月,一个月过后就会自动删除,请问下怎么实现那?

在发布信息表中有两个字段
一个是 记录发布时间的 regTime
一个是 状态标量 AdState
当用户发布广告的时候 把 发布信息和发布时间插入到数据库中
注意:发布时间是服务器时间
状态设置默认值为1,(1表示正常,0表示过期)
update [tableName] set AdState=0 where regTime=(select regTime from [tableName] where regTime+30>getdate())
显示页的select 语句 写 select * from [table] where AdState=1

用 if datediff("m",date(),now())>=1 then
删除`~~

在发布信息表中有两个字段
一个是 记录发布时间的 regTime
一个是 状态标量 AdState
当用户发布广告的时候 把 发布信息和发布时间插入到数据库中
注意:发布时间是服务器时间
状态设置默认值为1,(1表示正常,0表示过期)
update [tableName] set AdState=0 where regTime=(select regTime from [tableName] where regTime+30>getdate())
显示页的select 语句 写 select * from [table] where AdState=1