Session arrays..

I have two session arrays…
say…

$_SESSION[‘x’] and $_SESSION[‘y’]

for example values of arrays like this…

$_SESSION[‘x’]—>a,b,c
and
$_SESSION[‘x’]—>p,q,r

in this case p value belongs to a, q value belongs to b… and so on.

is there anyway to store this values in a mysql table???

pls reply me…

it depens on what data is in that array, could u give us a real example.

and please writ it as a print_r output or a array definition. im not sure but i guess u ment ur array to look like this:

[code]$_SESSION[‘x’] = array( ‘a’=>‘p’ , ‘b’=>‘q’ , ‘c’=>‘r’ );

same but written diffrent:

$_SESSION[‘x’]:
Array (
[a] => p,
[b] => q,
[c] => r,
)

still the same:
$_SESSION:
Array (
[x] => Array (
[a] => p,
[b] => q,
[c] => r,
)
)

this can be created with print_r($_SESSION) and then copied and pasted[/code]

that way everbody knows exactly how ur array looks like, without u having to explain it with a lot of words.

this is i need to be done…

am trying to use session arrays for a shopping cart functionality…

in that i want to keep values of itemid’s in $_SESSION[‘cart’];

and selected qty for that particular product in $_SESSION[‘counts’];

$itemID=$_GET['item'];
$qty=$_GET['qty'];

$_SESSION['cart'][]=$itemID;
$_SESSION['counts'][]=$qty;]

now i wants to save those session values as paired values in mysql table.

for example…
lets say

user select itemid 12 and quantity is 2;
user select itemid 15 and quantity is 1;

am sorry my english is not good at all… hope get what am trying to say…

Sponsor our Newsletter | Privacy Policy | Terms of Service