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?pagegen wrote:am using that to clear the cart every night so it wont be a problem..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());
update or add to MYSQL not working
Moderator: General Moderators
Re: update or add to MYSQL not working
Re: update or add to MYSQL not working
oh no, should take a day.. ill test againonion2k wrote: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?pagegen wrote:am using that to clear the cart every night so it wont be a problem..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());
EDIT; nope, i gave a 3hour gap n it still stayed there.. after 1day gap delets