Please note that I have 3 product categories with products [3 tables db]... well 1st added to cart correct meaning i guess not this the problem... when go to add SECOND ITEM TO CART from same or differ category that makes the error...
As Rudy said, print off the SQL statement you are trying to execute and this will give you and us a better understanding of why it is failing at the database level. My posting was to show that it is quite likely that the table is not being populated in the SQL statement you are executing.
$this->Orders = quatity of product in array
$this->OrderTable[$ProdID] = table in db contains particular product info
SELECT * FROM olives WHERE productID='OLIVE003';
Garlic Stuffed Olives 1 $8.99
Notice: Undefined index: in C:\xampp\htdocs\Gosselin2006\Chapter.11\Chapter\ShoppingCart.php on line 74
SELECT * FROM WHERE productID='';
Unable to perform the query1.
Error code 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE productID=''' at line 1
$SQLstring = "SELECT * FROM ". $this->OrderTable[key($this->Orders)]." WHERE productID='".key($this->Orders)."';";
echo $SQLstring. "<br />";
$QueryResult = @mysqli_query($this->DBConnect, $SQLstring) or die("<p>Unable to perform the query1.</p>"."<p>Error code ".mysqli_errno($this->DBConnect).":".mysqli_error($this->DBConnect))."</p>";