stonecolddevin has asked for the wisdom of the Perl Monks concerning the following question:

Heeeey everyone,

I'm ATTEMPTING to write a script that will take a message entered by a user (entered into a mysql db), check it's entry time, subtract that time from the current time, and if the end result time is bigger than a certain number, delete it.

Can I get some help?

Thanks,

-Dhoss


And if you're feeling lucky... come and take me home And if you feel loved If you feel lucky, if you feel loved If you feel lucky, if you feel loved You've crossed the walls - Excelled Further along through their hell All for my heart, I watch you kill You always have, you always will Now spread your wings and sail out to me....

Replies are listed 'Best First'.
Re: Chat room delete script?
by sgifford (Prior) on Aug 29, 2003 at 06:10 UTC
    Something like:
    DELETE FROM table WHERE entry_time < NOW - SECONDS(10)
    
    should do the job, although you'll have to translate it to your local dialect of SQL.
      Ahhh, thanks so much!!!

      And if you're feeling lucky... come and take me home And if you feel loved If you feel lucky, if you feel loved If you feel lucky, if you feel loved You've crossed the walls - Excelled Further along through their hell All for my heart, I watch you kill You always have, you always will Now spread your wings and sail out to me....