Ok, I am creating a catalog to sell photographs. I am integrating it using PayPal.
Here is how I have it set up....
I have two tables, one which holds the photograph title, description, photograph ID, thumbnail image name and full-size image name. The second table holds the print size, price, and the photograph ID. Obviously I am relating the two tables using the Photgraph ID. To see how it works, check out this page http://www.swtruckaccessories.com/prudential/image.php?id=LIT002.
The problem comes when you click the add to cart button under a specific size. It will take you to a page where you can review the item, select a finish and finally add it to your paypal cart. I am having a problem isolating a specific row in the size table. I tried passing the unique index of the particular size row through the query string which is then embedded in the SQL statement. What is the correct SELECT syntax to accomplish this?
In the URL I gave above the photograph ID is LIT002 and there are three sizes relating to that photograph but I want it so when they click the add to car button it takes them to the review page for that specific print size, not all three relating to that same photograph.
This is what I tried and didnt work...
$result = mysql_query("SELECT * FROM images, size WHERE PI='$id' AND index='$id' ",$db);
PI is the unique ID in the photograph information table and index is the unique ID in the print size table.
I hope I am explaining this correctly. If anyone can help please let me know!
Thanks!