Page 2 of 2

Re: update or add to MYSQL not working

Posted: Fri Sep 05, 2008 5:16 am
by onion2k
pagegen wrote:

Code: Select all

               $yesterday = date('Y-m-d H:i:s', mktime(0,0,0, date('m'), date('d') - 1, date('Y')));
                $sql = "DELETE FROM TblBasket WHERE CartDate < '$yesterday'";
                mysql_query($sql) or die(mysql_error());
am using that to clear the cart every night so it wont be a problem..
So if I come to your site at 11:55pm and try to buy some stuff, and it takes me 10 minutes, won't my cart be deleted half way through purchasing?

Re: update or add to MYSQL not working

Posted: Fri Sep 05, 2008 5:17 am
by pagegen
onion2k wrote:
pagegen wrote:

Code: Select all

               $yesterday = date('Y-m-d H:i:s', mktime(0,0,0, date('m'), date('d') - 1, date('Y')));
                $sql = "DELETE FROM TblBasket WHERE CartDate < '$yesterday'";
                mysql_query($sql) or die(mysql_error());
am using that to clear the cart every night so it wont be a problem..
So if I come to your site at 11:55pm and try to buy some stuff, and it takes me 10 minutes, won't my cart be deleted half way through purchasing?
oh no, should take a day.. ill test again :)

EDIT; nope, i gave a 3hour gap n it still stayed there.. after 1day gap delets