I'm working on a lightbox using an array stored in a session and I'm trying to figure out how to empty the lightbox and also how to delete individual items. I have a button at the bottom of the page for clearing the lightbox using this code (sessionDbTest4 is the current file):
echo "<form action='sessionDbTest4.php' method='get'>\n
<input type='hidden' name='clear' value='true'>\n
<input type='submit' value='Clear Cart'>\n
</form>";
and then closer to the top of the page I have the code:
if ($clear=='true')
{
unset($_SESSION['subcategories']);
}
and instead of emptying the array it displays the whole list of items that were in the array but then at the end it says "could not execute query" which is the or die message for the display loop query. Any suggestions on how I should be doing this?