Re: Deleting older records

From: Date: Fri, 13 Aug 2004 05:48:54 +0000
Subject: Re: Deleting older records
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-35682@lists.php.net to get a copy of this message
wat about using php mktime() (codes below not tested)?? $time = date("YmdHis", mktime(date("H")-1, date("i"), date("s"), date("m"), date("d"), date("Y"))); $query = "DELETE FROM tblDownloadTrack WHERE timestamp < '$time'"; mysql_query($query); ----- Original Message ----- From: "Dylan Barber" <dylan.barber@earthlink.net> To: "'Ng Hwee Hwee'" <hhwee@towa.com.sg>; <php-db@lists.php.net> Sent: Friday, August 13, 2004 1:32 PM Subject: RE: [PHP-DB] Deleting older records > Okay closer but the query doesn't seem to return anything > > Query > > DELETE FROM tblDownloadTrack WHERE > TIME_TO_SEC(timestamp) < > TIME_TO_SEC( NOW( ) )-60 > > Is this even the right track for something like this? > > Dylan Barber > > www.codegalaxy.com - A webservices company > > DotNetNuke Portal Specialists > > Simple Affordable & Reliable - Web Design, and Programming > > > > > -----Original Message----- > > From: Ng Hwee Hwee [mailto:hhwee@towa.com.sg] > > Sent: Friday, August 13, 2004 12:23 AM > > To: php-db@lists.php.net > > Subject: Re: [PHP-DB] Deleting older records > > > > try > > > > DELETE FROM tblDownloadTrack WHERE > > timestamp < > > TIME_TO_SEC( NOW( ) ) > > > > ----- Original Message ----- > > From: "Dylan Barber" <dylan.barber@earthlink.net> > > To: "'Ng Hwee Hwee'" <hhwee@towa.com.sg>; > > <php-db@lists.php.net> > > Sent: Friday, August 13, 2004 1:17 PM > > Subject: RE: [PHP-DB] Deleting older records > > > > > > > 1064 - You have an error in your SQL syntax. Check the manual that > > > corresponds to your MySQL server version for the right > > syntax to use near > > '* > > > FROM tblDownloadTrack WHERE > > > timestamp < TIME_TO_SEC( > > > > > > > > > Dylan Barber > > > > > > www.codegalaxy.com - A webservices company > > > > > > DotNetNuke Portal Specialists > > > > > > Simple Affordable & Reliable - Web Design, and Programming > > > > > > > > > > > > > -----Original Message----- > > > > From: Ng Hwee Hwee [mailto:hhwee@towa.com.sg] > > > > Sent: Friday, August 13, 2004 12:15 AM > > > > To: php-db@lists.php.net > > > > Subject: Re: [PHP-DB] Deleting older records > > > > > > > > what was the error?? > > > > > > > > ----- Original Message ----- > > > > From: "Dylan Barber" <dylan.barber@earthlink.net> > > > > To: <php-db@lists.php.net> > > > > Sent: Friday, August 13, 2004 1:08 PM > > > > Subject: [PHP-DB] Deleting older records > > > > > > > > > > > > > I have a tracking database but I only need things in it for > > > > about an hour > > > > > > > > > > I tried this > > > > > > > > > > DELETE * FROM tblDownloadTrack WHERE > > > > > timestamp < > > > > TIME_TO_SEC( NOW( ) ) > > > > > > > > > > > > > > > > > > > > but it gives me an error anybody help me out on this? > > > > > > > > > > MySQL 4.0.16 > > > > > > > > > > > > > > > Dylan Barber > > > > > > > > > > > > > > > > > > > <file:///C:/Documents%20and%20Settings/Dylan/Application%20Dat > > > > a/Microsoft/Si > > > > > gnatures/www.codegalaxy.com> www.codegalaxy.com - A > > > > webservices company > > > > > > > > > > DotNetNuke Portal Specialists > > > > > > > > > > Simple Affordable & Reliable - Web Design, and Programming > > > > > > > > > > > > > > > > > > > > > > > -- > > > > PHP Database Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: > > > > http://www.php.net/unsub.php > > > > > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.db (#35682) next »