Hi Ray,
I upgraded to the DataBridge v2 and started as you described in your previous post. It seems pretty straight forward but I am now probably running into some coding issues / MySQL - MySQLi conflicts. I am trying to learn and fix some of them myself but want to ask you to help with the first problems - maybe they help with the other pages too.
I have not uploaded to the server yet so the following error message refer to my local MAMP:
In the "/products_result.php" page I get the following error:
Notice: Undefined index: ProductCategoryID in /Applications/MAMP/htdocs/NavariniUSA/products_results.php on line 10
Notice: Undefined index: ProductSubCat2ID in /Applications/MAMP/htdocs/NavariniUSA/products_results.php on line 11
Notice: Undefined index: CategoryID in /Applications/MAMP/htdocs/NavariniUSA/products_results.php on line 24
Fatal error: Uncaught Error: Call to undefined function GetSQLValueString() in /Applications/MAMP/htdocs/NavariniUSA/products_results.php:34 Stack trace: #0 {main} thrown in /Applications/MAMP/htdocs/NavariniUSA/products_results.php on line 34
The first notice messages refer to:
Line 10:
$WADAproducts->bindParam("i", "".($_GET['ProductCategoryID']) ."", "-1"); //ProductCategory
Line 11:
$WADAproducts->bindParam("i", "".($_GET['ProductSubCat2ID']) ."", "-1"); //subcategory3
Line 24:
$rs_Categories->bindParam("i", "".($_GET['CategoryID']) ."", "-1"); //CatName
The Fatal error to:
Line 34:
$query_rs_SubCategories2 = sprintf("SELECT * FROM subcategories2 WHERE SubCat2ID = %s", GetSQLValueString($SubCat2Name_rs_SubCategories2, "int"));
The entire code above the Doctype is:
<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?>
<?php require_once('Connections/Amiganien_DB_i.php'); ?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php
$WADAproducts = new WA_MySQLi_RS("WADAproducts",$Amiganien_DB_i,0);
$WADAproducts->setQuery("SELECT * FROM products WHERE ProductCategoryID = ? AND ProductStore LIKE '%%NA%%' OR ProductSubCatID = ? AND ProductStore LIKE '%%NA%%' OR ProductSubCat2ID = ? AND ProductStore LIKE '%%NA%%' ORDER BY ProductPrice ASC");
$WADAproducts->bindParam("i", "".($_GET['ProductCategoryID']) ."", "-1"); //ProductCategory
$WADAproducts->bindParam("i", "".($_GET['ProductSubCat2ID']) ."", "-1"); //subcategory3
$WADAproducts->bindParam("i", "".($_GET['ProductSubCatID']) ."", "-1"); //subcategory2
$WADAproducts->execute();
?>
<?php
$rs_SubCategories = new WA_MySQLi_RS("rs_SubCategories",$Amiganien_DB_i,1);
$rs_SubCategories->setQuery("SELECT * FROM subcategories WHERE SubCatID = ?");
$rs_SubCategories->bindParam("i", "".($_GET['SubCatID']) ."", "-1"); //SubCatName
$rs_SubCategories->execute();
?>
<?php
$rs_Categories = new WA_MySQLi_RS("rs_Categories",$Amiganien_DB_i,1);
$rs_Categories->setQuery("SELECT * FROM productcategories WHERE CategoryID = ?");
$rs_Categories->bindParam("i", "".($_GET['CategoryID']) ."", "-1"); //CatName
$rs_Categories->execute();
?>
<?php
$SubCat2Name_rs_SubCategories2 = "-1";
if (isset($_GET['SubCat2ID'])) {
$SubCat2Name_rs_SubCategories2 = $_GET['SubCat2ID'];
}
$Amiganien_DB_i->select_db($database_Amiganien_DB_i);
$query_rs_SubCategories2 = sprintf("SELECT * FROM subcategories2 WHERE SubCat2ID = %s", GetSQLValueString($SubCat2Name_rs_SubCategories2, "int"));
$rs_SubCategories2 = $Amiganien_DB_i->query($query_rs_SubCategories2) or die($mysqli->error);
$row_rs_SubCategories2 = $rs_SubCategories2->fetch_assoc();
$rs_SubCategories->TotalRows2 = $rs_SubCategories2->num_rows;
?>
Any pointer is much appreciated.
Best,
Joerg