Populate a Drop down list with result from a SQL s

Results 1 to 3 of 3

Thread: Populate a Drop down list with result from a SQL s

  1. #1
    Brian Laws Guest

    Default Populate a Drop down list with result from a SQL s

    I know that someone has already filed a similiar question, but it <BR>was unclear to me what they were trying to do. So...... here is my question: Does anyone know how to populate a drop-down list with data returned from a SQL &#039select&#039 statement?

  2. #2
    Join Date
    Dec 1969
    Posts
    1,019

    Default RE: Populate a Drop down list with result from a S

    &#060;% mySQL="select ...." %&#062;<BR>&#060;select name="mydropdown"&#062;<BR>&#060;% do while not mySQL.eof %&#062;<BR>&#060;option value="&#060;%=mySQL("val1") %&#062;"&#062;&#060;%=mySQL("val2") %&#062;<BR>&#060;% mySQL.MoveNext<BR> loop<BR>%&#062;<BR><BR>this is a basic example, there are many different ways.<BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    74

    Default RE: Populate a Drop down list with result from a S

    Hey brian Leo Is correct there are several examples of this, the one I recently used and implemented was at asp101 site <BR>&#060;--! pulling from database--&#062;<BR><BR>http://www.asp101.com/samples/db_pulldown.asp<BR><BR>The above link is a good example of populating a pulldown with records from a database.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •