Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10

Thread: database to ASP

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    database to ASP

    id name jop

    1 john instructor
    2 alex engineer
    3 nadia doctor
    9 salah doctor
    10 goerg engineer
    11 ali doctor

    if each name has description in my database ,i need if i click on the name get his description from db and insert it in file decription.asp .iwant all the names's descriptions to be shown in the same file description.asp just on click on it

  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    Pilipinas
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you can do that in several ways. whilst the examples below aren't exactly what you want, the gist remains.

    selecting a record from db using a hyperlink

    selecting a record from db using a dropdownlist

    just change portions of the code to display only the description field for the selected record instead.

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    Pilipinas
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    oops, forgot the links to the code

    using a hyperlink

    using a dropdownlist

  • #4
    New Coder
    Join Date
    Jun 2002
    Location
    Pilipinas
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    actually, this example is more along the lines you want, though is done in asp.net.

    show me

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <a href="delete.asp?recno=<%=recno%>">
    i mean this sentece (?recno)
    how db know what i cliked, i think (?recno) is the solution but i need more explaination, also i have a similar code ,please care about in your words.
    <a href="shopdisplayproducts.asp?id=5&cat=Clothes">

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i think i under stand it,thanks you for all,but iwait for your explainations
    Last edited by ahmedsoliman; 07-04-2002 at 10:32 PM.

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    With the following code:

    <a href="delete.asp?recno=<%=recno%>">

    What will happen is when you click on the link, you will be taken to the page:

    http://www.whatever.com/delete.asp?recno=123

    In a URL, everything after (and including) the "?" is called a "Querystring". The "123" is an example - of course this value would actually be whatever the value of "recno" is when it's compiled on the server-side.

    On delete.asp, you would get the value "123" (or whatever other value was passed in the querystring), like this:

    <%
    recno = Request.QueryString("recno")
    %>


    Now you have a value for "recno" that you can use to access the database. If you want to make sure the value is being passed, you might write it to the next page, like so:

    <% = recno %>

    Which is short for <% Response.Write(recno) %>

    Regarding the other example you posted, you can pass quite a bit of information in a querystring - (I'm not quite sure what the limit is) - like so:

    www.whatever.com/whatever.asp?value1=<% = value1 %>&value2=<% = value2 %>

    etc. all you have to do is separate any additional querystring parameters with "&".

    P.S. Here's a pretty good link regarding querystrings, also his website has some useful information on ASP:

    http://www.haneng.com/Lessons_15.asp

    Last edited by whammy; 07-05-2002 at 11:36 PM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you very mush ,you are abest assistance here

  • #9
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #10
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    Glad I could help!




  •  

    Posting Permissions

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