need help with recordset sql logic
Hi Ray, I'm still hoping to get a premiere support ticket with you sometime. in the mean time, im trying to see if I can resolve myself to a working version (even though maybe not the most optimized approach).
currently my recordset is giving this error:
SELECT products.*, catalog.*, categories.* FROM catalog LEFT JOIN products ON catalog.CatalogProductID = products.ProductID LEFT JOIN categories ON catalog.CatalogCategoryID = categories.CategoryID WHERE (categories.CategoryLink = ?
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 7
The URL as an example is: http://localhost/armadillo/category.php?Department=Lighting&Category=Art-Work
And my SQL code is :
$rsProducts = new WA_MySQLi_RS("rsProducts",$ecartdb,0);
$rsProducts->setQuery("
SELECT products.*, catalog.*, categories.*
FROM catalog
LEFT JOIN products
ON catalog.CatalogProductID = products.ProductID
LEFT JOIN categories
ON catalog.CatalogCategoryID = categories.CategoryID
WHERE (categories.CategoryLink = ?");
$rsProducts->bindParam("s", "".(isset($_GET['Category'])?$_GET['Category']:"") ."", "-1"); //WAQB_Param1
$rsProducts->execute();
Are you able to see from here if there is an obvious logical error on my part?
I just want to attach the 2 files in question, in case you can see an obvious mistake. Aldo is there a way to improve the code as it just seems like a bad approach.