Mysqli Search Question - using Comma Seperated List
Is there a way to convert this code to work in the MySQLi Search Behaviour so that I can add other dynamic parameters to determine which saved products should be displayed.
<?php
$products_cookie = json_decode($_COOKIE['compare-products'], true);
$allKeys = array_keys($products_cookie); // see https://stackoverflow.com/a/4095810/175553
$allKeys = str_replace('ITEM-','',$allKeys); // see https://stackoverflow.com/a/4977085/175553
$productIDCollection = implode(',',$allKeys);
?>
<?php
$rsDataSet = new WA_MySQLi_RS("rsDataSet",$connMySQLi,0);
$rsDataSet->setQuery("SELECT p.* FROM tbl_products AS p WHERE p.id IN(?)");
$rsDataSet->bindParam("il", "".$productIDCollection ."", "-1"); //commaDelimitedList
$rsDataSet->execute();
?>
When I add a search to this recordset it removes the existing where clause which I know is expected behaviour.
$allKeys
is an array that could be used but when I try and pass it in I get the following error:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 78 bytes) in /Users/davidbuchholz/Sites/***/wwwroot/webassist/mysqli/rsobj.php on line 195
The array looks like this:
Array
(
[0] => 1481
[1] => 1480
)
when I do
print '<pre>';
print_r($allKeys);
print '</pre>';
Thanks.