Hi Ray, in Firebug I can see that the product IDs are being added. however after more than 1 product IDs get added to the cookie then I get a PHP error in syntax message (whats the php debug code to see what the error relates to?)
on the page with the error my recordset is:
Which I thought would work since I selected the comma-separated list checkbox in the recordset advance tab (see screenshot)
Chris
<?php
$rsViewedProducts = new WA_MySQLi_RS("rsViewedProducts",$ecartdb,1);
$rsViewedProducts->setQuery("SELECT * FROM products WHERE ProductID = ?");
$rsViewedProducts->bindParam("il", "".(isset($_COOKIE['ViewedProducts'])?$_COOKIE['ViewedProducts']:"") ."", "-1"); //colname
$rsViewedProducts->execute();
?>
I did change to this:
However I managed the Error in SQL syntax alert comes up if I clear the cookies. Also it doesnt display the product images just the one.
<?php
$rsViewedProducts = new WA_MySQLi_RS("rsViewedProducts",$ecartdb,1);
$rsViewedProducts->setQuery("SELECT * FROM products WHERE ProductID IN ?");
$rsViewedProducts->bindParam("il", "".(isset($_COOKIE['ViewedProducts'])?$_COOKIE['ViewedProducts']:"") ."", "-1"); //colname
$rsViewedProducts->execute();
?>
In the while loop I am using this code:
<?php
while(!$rsViewedProducts->atEnd()) {
?>
html.......................
<?php
$rsViewedProducts->moveNext();
}
$rsViewedProducts->moveFirst(); //return RS to first record
?>
I think if I can just this this solved here that be brilliant as I think its almost fixed.