RE: [PHP-WIN] Mysql Purge script
| From: | Ryan Vesely | Date: | Fri, 03 Oct 2003 17:07:48 +0000 |
| Subject: | RE: [PHP-WIN] Mysql Purge script | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-21670@lists.php.net to get a copy of this message | ||
just one way to create record created. not really relevant to the delete
statement, other than for reference.
----------------------------------------------------------------
Ryan Vesely
Sales Engineer
Pinnacor
685 Market Street, Suite 500
San Francisco, CA 94105
tel 415.369.4762
fax 415.512.2085
www.pinnacor.com <http://www.pinnacor.com/>
The preceding e-mail message contains privileged, confidential information.
Intended conveyance is only to designated and named recipient(s). If you
feel that you may have received this message in error or if you are not the
named recipient, please notify Pinnacor at once at the sender's email
address, or call 212.691.7900. Unauthorized use, dissemination, distribution
or reproduction of this message is strictly prohibited and may be unlawful.
-----Original Message-----
From: Svensson, B.A.T. (HKG) [mailto:B.A.T.Svensson@lumc.nl]
Sent: Friday, October 03, 2003 9:57 AM
To: ''php-windows@lists.php.net ' '
Subject: RE: [PHP-WIN] Mysql Purge script
As well as it assumes that a delete trigger takes care of
any dependent existences with other rows in other tables.
Secondly, what is the purpose of all assignments below?
-----Original Message-----
From: Ryan Vesely
To: 'Php2tor '; 'php-windows@lists.php.net '
Sent: 3-10-2003 18:35
Subject: RE: [PHP-WIN] Mysql Purge script
This assumes one of the columns on your DB is RecordCreated:
$today = getdate();
$year = $today['year'];
$month = $today['mon'];
$day = $today['mday'];
$hours = $today['hours'];
$minutes = $today['minutes'];
$seconds = $today['seconds'];
$RecordCreated = $year."-".$month."-".$day."
".$hours.":".$minutes.":".$seconds;
$delete_query = "DELETE from $table1 where (TO_DAYS(Now()) -
TO_DAYS(RecordCreated) >= 30));";
$execute_delete = mysql_query($delete_query) or die ("delete failed");
----------------------------------------------------------------
Ryan Vesely
Sales Engineer
Pinnacor
685 Market Street, Suite 500
San Francisco, CA 94105
tel 415.369.4762
fax 415.512.2085
www.pinnacor.com <http://www.pinnacor.com/>
The preceding e-mail message contains privileged, confidential
information.
Intended conveyance is only to designated and named recipient(s). If you
feel that you may have received this message in error or if you are not
the
named recipient, please notify Pinnacor at once at the sender's email
address, or call 212.691.7900. Unauthorized use, dissemination,
distribution
or reproduction of this message is strictly prohibited and may be
unlawful.
-----Original Message-----
From: Svensson, B.A.T. (HKG) [mailto:B.A.T.Svensson@lumc.nl]
Sent: Friday, October 03, 2003 9:27 AM
To: 'Php2tor '; 'php-windows@lists.php.net '
Subject: RE: [PHP-WIN] Mysql Purge script
DELETE FROM <table(s)>
WHERE <some-date-attribute-converted-to-days> > <than-30-days>
-----Original Message-----
From: Php2tor
To: php-windows@lists.php.net
Sent: 3-10-2003 18:15
Subject: [PHP-WIN] Mysql Purge script
Does anyone have a script that will purge a MySQL DB that
has entries over 30 days old?
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php