Page 1 of 1

confused? I am - using sess vars to insert/retrieve data

Posted: Wed Apr 01, 2009 11:40 am
by Borojimmy
Please forgive the length of this post!!,

I have an array that stores the name of a cart item in an array, the array is then stored as a session array,

forgive me if I am being stupid but if it is a session variable [array] does this mean that the session is now a global?

the reason I ask is, I have to use this data to discover the total cost of all the items.

this is the procedure:

The item page(call it item.php) has a few items on it each has a different value assigned to them, when the item is clicked the value is posted to a second page (call it cartupdate.php) and stored in the cartarray (stored as a session variable).

now the checkout page (call this checkout.php) needs cartArray to be displayed.

then using the values from the cartArray, I want to discover the prices of these items and add them together.

The items stored in the db also have the same names stored in cartArray.



I cannot ask for too much 'cos ita part of an assignment and to be honest if i ask someone else to show me I will never learn it properly.

what I suppose I need is some pointers on how to use session variables to manipulate data in a db. or if there atre any tutorials or online lessons on how to do this I would be very grateful!

Many thanks in advance for advice

Jim

if someone could let me know of any