Problem records being returned
I have set up my search page and when I search for 0070 8 foil balloons are returned. The recordset I am using for this is:
<?php
$rs_foil = new WA_MySQLi_RS("rs_foil",$dmbc_database,0);
$rs_foil->setQuery("SELECT products.id, products.itemnumber, products.description, products.categories, products.category_type, products.status, products.type, products.productdescription, products.typename, products.selling_quantity, products.price, products.image, products.imagelarge, products.volumediscount, products.supplier, products.supplierlogo, products.stock, products.onorder, products.packed, products.customer_back_orders, products.pending_online_orders, products.visible, products.product_arrival_date, special_prices.price AS special_price FROM products LEFT OUTER JOIN special_prices ON products.itemnumber = special_prices.itemnumber AND special_prices.userdetails_id = ? WHERE visible = 1 AND category_type='Foil Balloons' AND (products.itemnumber LIKE ? OR products.supplieritemnumber LIKE ? OR description LIKE ? OR keywords LIKE ? OR supplier LIKE ?) ORDER BY description ASC");
$rs_foil->bindParam("i", "".($rs_customer->getColumnVal("id")) ."", "-1"); //colname
$rs_foil->bindParam("c", "".(isset($_SESSION['keywords'])?$_SESSION['keywords']:"") ."", "-1"); //colname1
$rs_foil->bindParam("c", "".(isset($_SESSION['keywords'])?$_SESSION['keywords']:"") ."", "-1"); //colname2
$rs_foil->bindParam("c", "".(isset($_SESSION['keywords'])?$_SESSION['keywords']:"") ."", "-1"); //colname3
$rs_foil->bindParam("c", "".(isset($_SESSION['keywords'])?$_SESSION['keywords']:"") ."", "-1"); //colname4
$rs_foil->bindParam("c", "".(isset($_SESSION['keywords'])?$_SESSION['keywords']:"") ."", "-1"); //colname5
$rs_foil->execute();
?>
I then have an option to sort these by size/type using the following URL:
http://www.dmballooncompany.com/php/gb/registered/products/category_search.php?category=0070&category_type=Foil Balloons
The problem is no products are returned. The recordset I am using for this is below. It is modified version of the recordset at the top of the page and I am cannot seem to work out why no products are returned. What is even more strange is that if I search for love 82 products are returned and then when I click the URL to sort by size/type 82 products are shown.
<?php
$rs_products = new WA_MySQLi_RS("rs_products",$dmbc_database,0);
$rs_products->setQuery("SELECT products.id, products.itemnumber, products.description, products.categories, products.category_type, products.status, products.type, products.productdescription, products.typename, products.selling_quantity, products.price, products.image, products.imagelarge, products.volumediscount, products.supplier, products.supplierlogo, products.stock, products.onorder, products.packed, products.customer_back_orders, products.pending_online_orders, products.visible, products.product_arrival_date, special_prices.price AS special_price FROM products LEFT OUTER JOIN special_prices ON products.itemnumber = special_prices.itemnumber AND special_prices.userdetails_id = ? WHERE visible = 1 AND category_type=? AND (products.itemnumber LIKE ? OR products.supplieritemnumber LIKE ? OR description LIKE ? OR keywords LIKE ? OR supplier LIKE ?) ORDER BY type, description ASC");
$rs_products->bindParam("i", "".($rs_customer->getColumnVal("id")) ."", "-1"); //colname
$rs_products->bindParam("s", "".(isset($_GET['category_type'])?$_GET['category_type']:"") ."", "-1"); //colname1
$rs_products->bindParam("c", "".(isset($_GET['category'])?$_GET['category']:"") ."", "-1"); //colname2
$rs_products->bindParam("c", "".(isset($_GET['category'])?$_GET['category']:"") ."", "-1"); //colname3
$rs_products->bindParam("c", "".(isset($_GET['category'])?$_GET['category']:"") ."", "-1"); //colname4
$rs_products->bindParam("c", "".(isset($_GET['category'])?$_GET['category']:"") ."", "-1"); //colname5
$rs_products->bindParam("c", "".(isset($_GET['category'])?$_GET['category']:"") ."", "-1"); //colname6
$rs_products->execute();
?>
Any ideas?