470,620 Members | 1,377 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,620 developers. It's quick & easy.

selecting value from a drop-down menu

Contrary to what my screen name indicates, i'm actually quite new to SQL.
Having said that, I'll get right into my problem.
I'm trying to query an mssql database to return to the value that the user inputs through a drop-down menu in the databases GUI front-end (bugzilla actually). For example, a product is selected in a drop-down menu, and, depending on the product chosen, a second drop-down menu becomes active, containing a list of components attributed with that product. So, my query, in general looks like this:
Expand|Select|Wrap|Line Numbers
  1. SELECT product_id, component_id FROM bug_database WHERE bug_id = x;
the problem is is that these two values are returned as integers, representing the number in the list that they were chosen from. For example, if the product the user selected was, say, Firefox, and Firefox was the third item in the product list, the product_id that this query would return is simply: 3

How, instead, do I get the query to return Firefox, the item associated with the third item in the list, instead of the number in the list?

I appreciate any help I can get.
Sep 12 '07 #1
3 1907
5,821 Expert 4TB
Heya, Ramy. Welcome to TSDN!

Please use CODE tags when posting source code:

SQL code goes here.

I'm going to go ahead and move this thread to the MS SQL forum, where our resident Experts will be better able to help you out.
Sep 12 '07 #2
Shashi Sadasivan
1,435 Expert 1GB
So is the name Firefox stored in a different table?
Sep 12 '07 #3
2,878 Expert 2GB
something like:

Expand|Select|Wrap|Line Numbers
  1. SELECT product_id, component_id,thefieldthatholdsthebrowsername FROM bug_database WHERE bug_id = x;

then in your GUI, display the thirdfield...
Sep 13 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

19 posts views Thread by Ben Gribaudo | last post: by
2 posts views Thread by thomas | last post: by
6 posts views Thread by throat.wobbler.mangrove | last post: by
5 posts views Thread by SGershon | last post: by
2 posts views Thread by Will Newton | last post: by
2 posts views Thread by areef.islam | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.