Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Get the Selected from List (Drop Down List) and Find the associated Primary Key from Database

New Here ,
Oct 05, 2006 Oct 05, 2006
Hi,

I'm doing a web application with mysql as my database.
I have a List with dynamic values from my database. (The values can appear)
The values are names of people.. E.g. Amy, Ali, Bobby....
This is a insert function i'm doing...

When the user selects a name from the list. E.g. Amy
I need to know the ID of this person.
That is, my database contains a table 'Adult' and the columns are ID (primary key), name (amy, ali...) , etc..

Because this insert function i'm doing is on another table name 'Child' .. In this 'Child' table, there's a foreign key of the ID in Adult table. thus when inserting a new row for the child, i need to insert the associated adult which is the ID.

Hope you understand what i'm saying..
Anyway i use Visual Basic before and using the codes of VB... what i thinking was it seems like. ... (this is just a rough coding as i already forget the accurate codings)

ListBox1.Selected = varName
select ID from Adult where name = 'varName'

then i have to store the result i got into a hidden field so as to perform the insert command with the resulted id...

Thanks.
TOPICS
Server side applications
231
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 23, 2006 Oct 23, 2006
Hi,
Did you ever find a solution to your problem? I am having the same exact problem and have not gotten any answers.

Lisa
lisa@paraproductions.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 24, 2006 Oct 24, 2006
LATEST
nope. did not found the solution. *sighs
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines