Using Session Variables to create a shopping cart selection system
Hello,
I am having trouble controlling Session Variables.
Your WebAssist Cookies menu item allows me to use the following example code snippet:
<?php
@session_start();
if (!isset($_SESSION["TemporaryCart"])) {
$_SESSION["TemporaryCart"] = "".($rsQueryRecordSet->getColumnVal("OnlyOneItem")) ."";
}
?>
But what I in fact want is the entire array of items in that initial query. But nothing I have tried does this successfully.
I believe, for marketing purposes, that it would be effective if people thinking of purchasing a ticket could preview classes and imagine what they might attend. But I do not want to grant database access to such unpaid and unvetted previewers. It would surely open me up to attacks of all kinds.
I have already created the kind of a "shopping cart experience" I want, and it is already available to my paid ticket holders. But it of course runs by putting their selections into a database. They can browse the entire set of Classes for that day, and then select 4 ... 2 to "livestream", and 2 for later on demand viewing. Those go into the database.
For unpaid people, I thought Session Variables would work better. So I just want to fill a Session Variable with all the classes for that day as extracted from my database. Then previewers can select them from the available items in Session. I can create subarrays of their selections??
But I unfortunately cannot get the results from an initial recordset query into a Session Variable I can manipulate,
I have attached a copy a file that I want to emulate. I also provide credentials for a live version on the server so you can observe what I have done in action if necessary.
I believe that once I get the above code snipper WebAssist Tools provide me working on an entire array, rather than on a single item, I will have the means to select single items from the resulting array, I think I will then be fine with the usual key => variable PHP system.
Thank you for your help.