> From: Dave Koontz [mailto:[EMAIL PROTECTED]
> Not neccessarily. Put your awl on a sql database and add a timestamp
> column
> to the awl table, which gets automagically a new timestamp by the dbms
> each
> time a record is updated. The "timestamp" column type in Mysql is such
a
> type.
> 
> show create table awl:
> 
> CREATE TABLE `awl` (
>   `username` varchar(100) collate latin1_german1_ci NOT NULL default
'',
>   `email` varchar(200) collate latin1_german1_ci NOT NULL default '',
>   `ip` varchar(10) collate latin1_german1_ci NOT NULL default '',
>   `count` int(11) default '0',
>   `totscore` float default '0',
>   `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update
> CURRENT_TIMESTAMP,
>   PRIMARY KEY  (`username`,`email`,`ip`)
> ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
> 
> Then you can easily expire by date with a cron job, for example expire
all
> that was not updated for the last 30 days:
> 
> delete from awl where timestamp < now() - interval 30 day

Can you tell me how to do something similar for the bayes_seen table and
MySQL?

Thanks, Larry

Reply via email to