I'll admit upfront my noobness at php Javascript and ergo Ajax, though it will probably be obvious, so that is most definitely the problem. I am studying web development on my own, and I don't really have anyone around that can point out my errors... anyway enough of that.
Right, I have brain block with this adaptation of the fly-to-basket script I'm trying to implement.
Here's my scenario:
I have a working mysql db containing menu items (table name is menu_items). The menu list is generated by loop querying the db to list the items description and price. That works fine and each entry has it’s own Add button with a unique $productId var that is simply the id var from the db table called menu_items. It's not pretty but that part works. Here’s the HTML that is generated for each item:
<div class="product_container">
<div id="slidingProduct1" class="sliding_product">Egg Salad<br />3.39
<img src="../images/plateicon.gif"><p>
<a href="#" onclick="addToBasket(1);return false"><img src="images/basket.gif"></a>
<p/><br/></div>
The problem I'm having is getting the item clicked on to fly up and populate in the shopping_cart_items table. Instead I’ve managed to get only the first item in the list to fly over with the nefarious “Not a Numberâ€