I actually came up with a solution tonight. After everyone's help and suggestions I saw this was impossible to combine all in one query, so I had a brainwave and broke it into 2 queries. I used my original query, and then in an if statement farther down in my page, if the productName isnull then...
Ok, it's almost there but the ProductName does not show for anything in the rentals table since there is no join between rentals.movie = products.productID. Where does the third join fit in?
The end result is it only shows all fields in the table RentalSets and not the table Rentals. I need it to show all fields in Rentals, instead of RentalSets.
Thanks for that attempt. Any other suggestions?
Here are my three tables with the columns in question and sample data:
Products
ProductID ProductName
00001234 Test1
00001235 Test2
00001236 Test3
Rentals
MovieNo User MovieID
1 test@test.com 00001235
2 test@test.com 00001235-2
3...
On an ASP page I am looping through a table in a MYSQL database, which is retrieving a subproduct number based on a product number in the table. What gets outputted on the page in a form is buttons labeled "Rent Disc 1" "Rent Disc 2" "Rent Disc 3". When a button is clicked on, I want the...
The following code gets me 90% of the results I require. Hopefully this is simple for someone, but I cannot figure out how to make a third JOIN, if that is the way to go. Currently I have a JOIN between products and rentals, and a JOIN between rentals and rentalsets, but I also need a JOIN...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.