PHP SQL Nube needs assistance

Discussion in 'Programming' started by thewindmaster, Sep 27, 2006.

  1. #1
    I have a link dump site. Users can rate links and the script also tracks the clicks. I am wanting to add an area that shows the most popular and highest rated links.

    I have a table called babeloggerv2. With the table I have clicks - ratedtotal - ratedtally.

    For most popular total clicks would work. For rating I have to divide ratedtotal by ratedtally.

    Based on these figures I want tot display the top 5 for each category. I want to display the fields: imgname and title with title being a link to url.

    Any advice gets green.

    Thanks for your help.
     
    thewindmaster, Sep 27, 2006 IP
  2. DrMalloc

    DrMalloc Peon

    Messages:
    130
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In order to do that, you'll need to use a JOIN sql query on the two tables, assuming that you have one field in the links table (that contains the id of the link and the category) and one in the clicks table (that contains the id of the link that was clicked on). That'll let you query the clicks table to find the top clicked links for a given category. It's hard to explain though without knowing more about what you mean, any more clarification might make it easier for more people to provide help.
     
    DrMalloc, Sep 27, 2006 IP