Re: live records

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ryan A wrote:
Hey all,
Been working on this nearly the whole night so i dont really know if this is
all that hard or am just braindead.

Probably just need a pair of fresh eyes.

[ trimmed ]

sometimes items get deleted or are taken off the "active" list, when this
happens I would like to take out these times from $cart_arr....how do i do
that?


eg: user has these items in his cart ($cart_arr): 1 2 3 4

Item number 3 has been taken taken off the active list, so $cart_arr should
now contain only
1
2
4

You can simply unset() the key that holds that value.

So, for item three, you would say unset($cart_arr[2]); This will leave you with a gap in the array :

1
2

4

Your array still has 4 entries, but one of them is empty. You can modify your query loop to check for this.

Hope this helps.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux