I have a drop down that will be auto populated when the user selects a previous drop down. The one in question is referencing a particular piece of equipment attached to the company that was selected. The database is set up with a manufacturer table, equipment table, and customer equipment table. My issue is not knowing the correct SQL statement to write in order to display the appropriate equipment. The display in the drop should pull manufacturer name from the mfg table and the description from the equipment table at the same time it should be the unique equipment for that company (that is based on the serial number). A helping hand is much appreciated.
foundsheep
0
Junior Poster
Recommended Answers
Jump to Post"SELECT a.manufacturername, b.description FROM manufacturer a JOIN equipment b ON a.manufacturerID=b.manufacturerID"
This assumes that you have a relational database and they are setup like this:
Manufacturer
- manufacturerID
- manufacturernameEquipment
- manufacturerID
- equipmentID (unique or Primary)
- description
Jump to PostThat says that there is no column in your table with the name of mfgID
Jump to Postdoesn't say. Could be either.
Jump to PostIt's not working because you have no values to assign to it. And it won't fail cause nothing was done in the first place.
Check both your databases to assure yourself that mfgID is spelled correctly and exists in both tables.
Jump to PostOh woops, I wasn't paying attention.
You can only put values you retrieve into the DROPDOWNLIST. You never pulled mfgID so you cannot use it as a TextValue or DataValue. That query you want this:
"SELECT Company, mfgID FROM Manufacturers"
Then, after the user picks the …
All 21 Replies
SheSaidImaPregy
28
Veteran Poster
foundsheep
0
Junior Poster
SheSaidImaPregy
28
Veteran Poster
foundsheep
0
Junior Poster
SheSaidImaPregy
28
Veteran Poster
foundsheep
0
Junior Poster
SheSaidImaPregy
28
Veteran Poster
foundsheep
0
Junior Poster
SheSaidImaPregy
28
Veteran Poster
foundsheep
0
Junior Poster
foundsheep
0
Junior Poster
SheSaidImaPregy
28
Veteran Poster
SheSaidImaPregy
28
Veteran Poster
foundsheep
0
Junior Poster
SheSaidImaPregy
28
Veteran Poster
foundsheep
0
Junior Poster
foundsheep
0
Junior Poster
foundsheep
0
Junior Poster
SheSaidImaPregy
28
Veteran Poster
foundsheep
0
Junior Poster
SheSaidImaPregy
28
Veteran Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.