Jump to content

[SOLVED] Rating System. Need help with ARRAYs or other Solution


codexx

Recommended Posts

Hello Everyone,

Just working on a script that lets users rate each other (1 - 10) . I'm not sure if this is the most effective way, but I was thinking of making each vote a new entry, then retrieve them all into an array. After that add all of the array and devide by the total results to get the average.

If this is the best solution I know how to add and get the average, just don't know how to implent the results into the array.

If this isn't the best solution could you please point me in the appropriate direction :).

Thanks Alot,
Sean
Link to comment
Share on other sites

Thanks for you're quick reply Patrick!

Just another quick question so I'm sure I have this correctly.

How would this information then be outputted as normally I just use a while and fetch_assoc.

So far i've gotten..

$userrating = mysql_query("SELECT AVG(rating) FROM userratings WHERE rated = '".$user."'");
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.