I am running into a small problem with apending data to my sessions.
When adding only 1 set of data it works great!
output looks like this:
list_no|i:2;USER_NO|s:5:"35438";SELLERTYPE|s:5:"Owner";NAME|s:8:"45674576";URL|s:5:"76476";DURATION|s:7:"90 Days";LISTINGS|s:1:"C";TYPE|s:4:"Sale";PRICE|s:4:"4567";STARTPRICE|s:4:"4576";BIDINC|s:4:"4567";DESCRIPTION|s:10:"4567457647";PAY|a:1:{i:0;s:4:"Visa";}
My problem is, that the user has the option to add more than one of these entries, I can not figure out how to get them to stack.
Meaning having list_no 1 (with data) and list_no 2 (with data).
Here is the line of code that I have tried so far.
if(!isset($list_no)){
$list_no = 1;
session_register(list_no);
} else {
$list_no++;
}
for($i = 1; $i < $list_no; $i++){
session_register(USER_NO);
session_register(SELLERTYPE);
session_register(NAME);
session_register(URL);
session_register(DURATION);
session_register(LISTINGS);
session_register(TYPE);
session_register(PRICE);
session_register(STARTPRICE);
session_register(BIDINC);
session_register(DESCRIPTION);
for($i = 0; $i < count($PAY); $i++){
$pay2[] = $PAY[$i];
session_register(PAY);
}
}
This obviously isnt working, all it is doing is changing list_no to ++ from previous and is not stacking the data.
Any help is appreciated.... i am a bit sick at the moment, maybe that has something to do with my problem 😉
John