locked
need help with database linking/filtering RRS feed

  • Question

  • User-377887725 posted

    Ok, So i have a table tbl_SEO_URLS and 6 columns in that table...

    friendly (this is the .html address), path (source code file), Make, Model, moreModel, UnqId (Unique Id)

    I want a link like /Honda-Civic-Si.html. The make column (Honda), Model (Civic), More Model (Si), UnqId (1)

    Every car entered would have a different UnqId. Like the next one would have a UnqId of 2, and ect..

    Then on the web page (with the link /Honda-Civic-Si.html) i want it to say Thank you for looking at (Make, Model, moreModel) Honda Civic Si.

    I have all the connections working and can display information. The problem is how can i make basically one source page that can generate hundres of pages with the correct information correlating with the correct web address. (so the car infomration would be the same as the link in the address bar) I would like to set up A LOT of these pages but how can I get the UnqId (Unique Id) to only display the certain car. 

    I need somehow to say in the code when the user clicks on the link 'honda civic si' it says "hey its a UnqId of 1 so i better desplay the make, model, and moreModel in that row with the correct link also in that row. Do i usea  bunch of Arrays? 

    I'm getting to know asp and don't know it that well. help would be greatly appreciated... THANKS!

    Tuesday, August 16, 2011 5:56 PM

All replies

  • User617492218 posted

    i'm not sure why you're trying to make all those pages. first off convert your .html page into an .aspx page

    you can bind your Db to a lot of controls. lables in a table, datagrid, detailsview, formview, etc. 

    why not just put everything on one page or two pages - the 2nd being the thank you part - 

    post some of your code so i can understand what you are trying to accomplish.

    Tuesday, August 16, 2011 6:20 PM
  • User-330204900 posted

    Hi Ryan, is this regarding Dynamic Data?

    Wednesday, August 17, 2011 6:15 AM
  • User-377887725 posted

    post some of your code so i can understand what you are trying to accomplish.

    Sub carMakes()
    dim sql, rs, Unique, UniqueId, Make, Model, moreModel
     
    If Request("Id")=1 Then
     Unique="1"
    ElseIf Request("Id")=2 Then
     Unique="2"
    
    end if
    
    sql = "SELECT Make, Model, moreModel, UnqId FROM tbl_SEO_URLS WHERE unqId= " & Unique 
    'create the recordset
    set rs=server.CreateObject("ADODB.Recordset")
    'open the recordset
    rs.Open sql, Cnn
     UniqueId = rs("UnqId")
     Make = rs("Make")
     Model = rs("Model")
     moreModel = rs("moreModel")
    
    
    
    If Unique = UniqueId Then
    Response.Write(vbcrlf&" <td><strong>About " & Make & Model & moreModel & "<strong><br></td>")
    End If
    
    Set rs=Nothing
    End Sub

    Then i have another page set up for the links.. sitemap1.asp ....

    <input type="hidden" value="1" name="Id"/> <a href="SEO-Honda-Civic-Si-Custom-Wheels-Rims.html"> Honda Civic Si</a> <br />
    <input type="hidden" value="2" name="Id"/> <a href="SEO-Honda-Accord-Si-Custom-Wheels-Rims.html"> Honda Accord</a>
    
    

    I'm trying to get the Id and the Value into the asp code snippet. then after that is done it saves the number as a variable (Unique="1") that variable is then ran in an sql statement for the WHERE clause. How can i get the asp code found in SEOcarMake.asp to grab the html variables from sitemap1.asp ????

    Wednesday, August 17, 2011 10:35 AM
  • User3866881 posted

    Hello ryans18:)

    Very sorry but I really don't know what you want.....

    Suppose your sitemap.asp looks like this:

    <input type="hidden" value="1" name="Id"/>

    <a href="SEO-Honda-Civic-Si-Custom-Wheels-Rims.html"> Honda Civic </a>

    So what did you want to do with it????

    And I guess if you are clicking the Honda Civic, it will jump to page "SEO-Honda-Civic-Si-Custom-Wheels-Rims.html", You want to get what's in the <input type's value????

    Plz clearify your problem again.

    Thx

    Wednesday, August 17, 2011 10:48 PM
  • User-377887725 posted

    And I guess if you are clicking the Honda Civic, it will jump to page "SEO-Honda-Civic-Si-Custom-Wheels-Rims.html", You want to get what's in the <input type's value????

    Thx

    Yes, I want to get whats in the input types value. that value (ex. 1) 1 is also the number for my UnqId in my database. When that number is found it will display some information that is also in that same row. The program works if i define Unique = "1" (without the if statements) before the sql query. I just need to grab the information from that link so that he number is defined for my UnqId in my database.

    Thursday, August 18, 2011 11:45 AM
  • User3866881 posted

    Yes, I want to get whats in the input types value.

    But why don't you use this directly?

    <a href="SEO-Honda-Civic-Si-Custom-Wheels-Rims.html?id=1"> Honda Civic </a>

    And then use something like

    Request.QueryString("id") to accept the value?

    PS:Are you using Asp.net technology or pure asp?

    Friday, August 19, 2011 4:23 AM