Strange session error
Posted: Sun Jan 28, 2007 12:52 am
Well I'm still making this e-commerce website and I thought my system was finished until I did further testing. Guess what? I can't delete items consistently.
And I've got the weirdest thing. Look at this:
Its printing "2 0." What's up with that??
I'm getting different values. I set it up so that deleting an item simply sets its quantity to zero, and ignores those items. Inefficient, I know, but unset() wasn't working properly. Now this isn't either.
Both methods worked sometimes, but not always. There's got to be a reason for this.
And I've got the weirdest thing. Look at this:
Code: Select all
$current = 0;
foreach($_SESSION['cart'] as $cartItem)
{
echo $cartItem['qty']." ".$_SESSION['cart'][$current]['qty'];
$current++;
}I'm getting different values. I set it up so that deleting an item simply sets its quantity to zero, and ignores those items. Inefficient, I know, but unset() wasn't working properly. Now this isn't either.
Both methods worked sometimes, but not always. There's got to be a reason for this.