Rating

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Amir Ghezelbash

    Rating

    Hello every one
    i had a question i am developing a site where i want users to be able to
    rate products..but i want users to be able to only vote once per
    product...i was wondering if any of you know could shed some light on
    how i can accomplish this..i thought of using cookies but cookies can be
    deleted...how can i keep track if a speicifc user has voted for a
    specficed product or not

    thank you

    ---
    Best Regards
    Amir

    *** Sent via Developersdex http://www.developersdex.com ***
  • Mark R. Dawson

    #2
    RE: Rating

    Hi Amir,
    probably the most affective way to do this is to require the user to
    register and login before they can vote. Obviously if they really want they
    can have multiple logins but it would be a deterant. Once the usre has voted
    they are not allowed to vote again.

    Mark.

    "Amir Ghezelbash" wrote:
    [color=blue]
    > Hello every one
    > i had a question i am developing a site where i want users to be able to
    > rate products..but i want users to be able to only vote once per
    > product...i was wondering if any of you know could shed some light on
    > how i can accomplish this..i thought of using cookies but cookies can be
    > deleted...how can i keep track if a speicifc user has voted for a
    > specficed product or not
    >
    > thank you
    >
    > ---
    > Best Regards
    > Amir
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    >[/color]

    Comment

    • Amir Ghezelbash

      #3
      RE: Rating


      Hi Mark,
      Thank you for your reply..users do have accounts...but my problem is how
      to keep track of what user has voted for what product..i mean i dont
      really want it to get into Sql sever..becuase it would just be a huge db
      filler..you know all users ...all products..what products have
      voted..what users have voted for that specific product...all too
      overwhleming... is there an easy way of doing this?
      ---
      Best Regards
      Amir

      *** Sent via Developersdex http://www.developersdex.com ***

      Comment

      • Jeff

        #4
        Re: Rating

        Hi Amir
        RE:
        << it would just be a huge db filler..you know all users ...all
        products..what products have voted..what users have voted for that specific
        product...all too overwhleming... i>>

        It wouldn't have to be as huge as you say if you have a good data model for
        this piece. You could have a simple junction table that logically sits
        between your [users] and [products] tables. Only enter a row in this
        junction table if the user voted. Absence of a row means absence of a vote.
        So if the query "tell me if UserX has voted on ProductZ" returns zero rows,
        then you know the user has not yet voted. The junction table could also
        include additional properties of the vote, itself, like Date/Time of the
        vote, or a product grade assigned (if they can assign some grade to a
        product as part of their vote). This junction table could be relatively
        small if all it has to do is store numeric IDs. Even tens of thousands of
        rows would not amount to much space if it's just numerical and Date/Time
        data.

        -HTH






        "Amir Ghezelbash" <amir_gh99@hotm ail.com> wrote in message
        news:%23lZjbcFJ GHA.528@TK2MSFT NGP12.phx.gbl.. .[color=blue]
        >
        > Hi Mark,
        > Thank you for your reply..users do have accounts...but my problem is how
        > to keep track of what user has voted for what product..i mean i dont
        > really want it to get into Sql sever..becuase it would just be a huge db
        > filler..you know all users ...all products..what products have
        > voted..what users have voted for that specific product...all too
        > overwhleming... is there an easy way of doing this?
        > ---
        > Best Regards
        > Amir
        >
        > *** Sent via Developersdex http://www.developersdex.com ***[/color]


        Comment

        • john smith

          #5
          Re: Rating

          Amir Ghezelbash wrote:[color=blue]
          > Hi Mark,
          > Thank you for your reply..users do have accounts...but my problem is how
          > to keep track of what user has voted for what product..i mean i dont
          > really want it to get into Sql sever..becuase it would just be a huge db
          > filler..you know all users ...all products..what products have
          > voted..what users have voted for that specific product...all too
          > overwhleming... is there an easy way of doing this?
          > ---
          > Best Regards
          > Amir
          >
          > *** Sent via Developersdex http://www.developersdex.com ***[/color]

          There are only so many ways to do something like this:

          -Cookies (not really effective like you said)
          -Tracking by IP (quite bad too, lots of people can share the same IP on
          some networks, ppl can use proxies to cheat the system still, ppl on
          dialup with dynamic IPs, etc)
          -And the old tracking with a database... A simple table like this should
          work:

          [ID] ID/pri key of ratings table (could do without if you wanted to...)
          [UserID] FK to user's table
          [ProductID] FK to products table
          [Rating] the rating/vote itself

          But yes, it can grow quite a lot (you could theorically have as many
          rows in it than total_users*tot al_products; although that won't happen
          it can get quite huge if site is big and popular), more burden on the DB
          itself, more queries executed per page, more code, more sprocs, more
          business logic/rules, more unit tests, more bugs to fix, etc. It's not
          that huge or overwhelming, but I can see why you don't really feel like
          it either, but it's the only real way to do this unfortunately.

          Comment

          Working...