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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile how can i show and calculate total records count from tables.

    Hi, i have some problem in showing data.

    I have two tables
    First table(containing Hosting categories)
    Second table(Containg catagories data like url,keyword,description.....etc)

    I want to display catgories names from first table and then diffrent catagories
    total records from second table, like this
    ASP.NETHosting(10)
    Linux Hosting(20)
    Windows hosting(13)
    :
    :
    :
    etc


    How could i do this pls tell me
    THANKS

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    make a function of it,,
    something like,,
    Code:
    Function GetCatCount(CatId)
    
    SQL = "Select Count(*) from Catagories where Cid="&CatId
    Set rs = myconn.Execute(SQL)
    GetCatCount= rs(0)
    rs.close
    set rs  = nothing
    set sql = nothing
    
    End Function
    then call it like:
    Code:
    response.write GetCatCount(123)


  •  

    Posting Permissions

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