473,748 Members | 5,242 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

selecting value from a drop-down menu

1 New Member
Hello,
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;
  2.  
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.
Thanks,
_ramy
Sep 12 '07 #1
3 2167
pbmods
5,821 Recognized Expert Expert
Heya, Ramy. Welcome to TSDN!

Please use CODE tags when posting source code:

[CODE=sql]
SQL code goes here.
[/CODE]

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 Recognized Expert Top Contributor
So is the name Firefox stored in a different table?
Sep 12 '07 #3
ck9663
2,878 Recognized Expert Specialist
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

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

Similar topics

19
3701
by: Ben Gribaudo | last post by:
Hello! I am trying to query a MySQL table and retrieve either the earliest or the latest message in each thread. The messages are in a table with MsgID being the primary key and fThreadID identifying to which thread the message belongs. Examples below. Any ideas on the SQL I need to use here?
2
1536
by: thomas | last post by:
Hello all Im having problems with selecting subelements from a dynamic created RTF converted to a node-set: i have hardcodet this example: the xml structure: <xsl:variable name="test">
6
42322
by: throat.wobbler.mangrove | last post by:
Hi, I was hoping someone may be able to help me with a tricky T-SQL problem. I need to come up with a SELECT statement that does basically the following: Select RCRD_REFNO, MAX(MODIF_DTTM) as MODIF_DTTM from ..tblPersonInfo group by RCRD_REFNO
5
10263
by: SGershon | last post by:
Hi! Since the first questions I asked here, I continue to drop by and read some topics here and there, I like the replies very much. I have today another question, I don't seem to find it on the FAQ (please point me if its there): I have two selects, one written 'directly on the page' and a second written dinamically by JavaScript. (Actually, both are written by php
1
2567
by: Ramesh | last post by:
hi, I am selecting fields from three table for manupulating data and i want to display total number of records selected. But i am always getting -1 value, eventhough 1000 of records are selected. Below is my code. here strSelectSQL value is strSelectSQL = "Select emp.Empno, emp.FirstName, emp.LastName, emp.DB, emp.DOJ,emp.Grade,emp.yearofexperience,
2
1368
by: Will Newton | last post by:
I have attached some SQL which produces what to me, at least, is rather unexpected results. Selecting real columns into double precision columns loses some precision. Is this expected or documented anywhere? Thanks, ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster
48
3867
by: phillip.s.powell | last post by:
MySQL 3.23.58 - 4.0.17 (yep, several database server instances, don't ask) I have database Spring with table Students I have database Summer with table Students I am tasked to produce a query of all students in both tables with no duplicates. No clue whatsoever.
2
3661
by: areef.islam | last post by:
Hi, I am kinda new to javascript and I am having this problem with selecting multiple options from a select tag. Hope someone can help me out here. here is my code /////////////////////////////////////////////////////////////////////////////////////// <form action="whatever.php" method="post"> <select name="zip_code" onchange="makeRequest('getCity.php?state='+this.form.zip_code.options.value)" multiple="multiple" size="20">
2
1354
by: MLH | last post by:
Lets say I have a combo box control on a form whose recordsource is a table called tbl_PotentialVINs. For argument's sake, say the table has 10 records. A user types a VIN into the control - say its one of those in the table. Now he doesn't drop the list and select it - he types in all 17-characters one-at-a-time. Is there any way to tell he did that in the control's AfterUpdate event property code? That is, type each
4
2107
by: darrel | last post by:
I have a DDL list along these lines: item value="1" text="a" item value="2" text="b" item value="3" text="c" item value="2" text="d" item value="2" text="e" item value="1" text="f" item value="1" text="g"
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.