Re: Emptying mySQl database on time-based factor!!!

From: Date: Sat, 25 Nov 2000 05:19:19 +0000
Subject: Re: Emptying mySQl database on time-based factor!!!
Groups: php.general 
Request: Send a blank email to php-general+get-27095@lists.php.net to get a copy of this message
Could there be another way out of this? COudl i do it some other way? For each user there is a session being created. Can i use that for this? The database takes in a the SesisonID, Name & some other columns in a row. COuld i use somekind of Session log-out stuff to erase each row pertaining to that sessionID after a given period? Regards, T. Edison jr. --- Richard Lynch <richard@zend.com> wrote: > Not with just MySQL -- It doesn't have fancy > triggers and timing stuff like > that. > > You could write a crontab PHP script to do it. > > Add a timestamp column to each table, and simple > have a series of: > $query = "delete from blah where update + '@ 2 > hours' <= now() and name = > 'criteria'"; > mysql_query($query); > > You may need to read up on cron/crontab: > man cron > man 5 crontab > man 8 crontab (8? maybe not 8. See the "See Also" > in the other entries) > > ----- Original Message ----- > From: "Thomas Edison Jr." <thomasedisonjr@yahoo.com> > Newsgroups: php.general > Sent: Friday, November 24, 2000 4:25 AM > Subject: [PHP] Emptying mySQl database on time-based > factor!!! > > > > Can we set a time out for deleting entries in the > > mySQl databased on a certain criteria?? This may > sound > > akward maybe... but let's see this... > > > > Someone's been entering stuff into mySQL db. > > He goes away.. and maybe after one or tw0 hours of > his > > dissapearing act..i would like records pertaining > to > > him from the table be deleted!! Taking maybe his > name > > into 'criteria'. > > > > Help Appreciated. > > > > > > ===== > > Rahul S. Johari (Director) > > ****************************************** > > Abraxas Technologies Inc. > > Homepage : http://www.abraxastech.com > > Email : abraxastech@yahoo.com > > Tel : 91-4546512/4522124 > > ******************************************* > > > > __________________________________________________ > > Do You Yahoo!? > > Yahoo! Shopping - Thousands of Stores. Millions of > Products. > > http://shopping.yahoo.com/ > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: > php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: > php-general-help@lists.php.net > > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribe@lists.php.net > For additional commands, e-mail: > php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > ===== Rahul S. Johari (Director) ****************************************** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : abraxastech@yahoo.com Tel : 91-4546512/4522124 ******************************************* __________________________________________________ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/

« previous php.general (#27095) next »