Jump to content

Cycle through 5 users information


Vel

Recommended Posts

Hey guys, I'm not sure where to start with this one so I thought it would be best if I explain what I want to achieve and then hopefully you awesome guys can point me in the right direction for getting it done.

 

I have a table with users. I have another table with ratings and comments for users. What I want to do is pick the top 5 rated users, a random comment, and then display them sequentially one at a time on my website. I have a box on the right hand side of the website in which the top rated user's details would be displayed, along with the random comment. After x number of seconds it would fade to another user. Once it gets back to the first user I would like it to load another random comment using Ajax.

 

How would I go about this?

Link to comment
Share on other sites

This would be a good question for KickStart,

 

however its quite an easy process which you can do completely in SQL.

 

I'll provide some resources for you:

http://www.sql-tutorial.net/SQL-JOIN.asp - Using Join can take two tables and merge them based on common columns. Hence merge your Users and Comments based on the USER ID, then do a RAND on the comment's ID with a LIMIT of 5.

 

 

Link to comment
Share on other sites

That's helpful, thank you :). That covers getting the information I need out of the database nicely.

 

However I'm also unsure what would be the best way to get the details displayed on a page to cycle every x seconds. I've seen it done on other websites but I have no idea how they do it, and no idea what to type in google to get a good guide to teach me how to do it.

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.