Re: deleting carts

From: Date: Sun, 25 Feb 2001 04:39:28 +0000
Subject: Re: deleting carts
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-6928@lists.php.net to get a copy of this message
Hi Nick, Of course it's possible. Anything is possible. Simply generate a simple PHP script that will be executed from the command line which is called from a cron. The PHP script would simple delete any records where (current date) - (your date_added) >= 90 days. On the other hand, on the shopping cart that I wrote, I did it another way; instead of creating a separate script and additional external components (the cron for example), simple create 1 function that holds the functionality needed to delete the old records. Then just call the function each time your cart script is called. There's no reason to create a cron to delete records because you can have the shopping cart script do it automatically... Hope this helps, Jorge santos@net-lynx.com ----- Original Message ----- From: Nicholas W. Miller <nick@webzeit.com> To: <php-db@lists.php.net> Sent: Saturday, February 24, 2001 11:31 PM Subject: [PHP-DB] deleting carts > I am developing a shopping cart style e-commerce web site. I have a > table called carts that holds users' cart items ... so one user may > have several entries in this table: > > +----------------+--------------+------+-----+---------+-------+ > | Field | Type | Null | Key | Default | Extra | > +----------------+--------------+------+-----+---------+-------+ > | cust_id | int(11) | | | 0 | | > | item_id | int(11) | YES | | NULL | | > | qty | tinyint(4) | YES | | NULL | | > | price | float(10,2) | YES | | NULL | | > | date_added | timestamp(6) | YES | | NULL | | > +----------------+--------------+------+-----+---------+-------+ > > I would like to write a PHP script that I will cron which will delete > all items belonging to a user if their most recent item is over 90 > days old. > > Is this possible? > > Nick > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#6928) next »