Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ratings 1

Status
Not open for further replies.

manicleek

Technical User
Jun 16, 2004
143
GB
I am trying to do a piece of code to take the ratings which users give companies in a review, average them out and then print them on the screen.

Can anyone help me with a piece of code that can do this.

the code is coming from a mysql table called reviews, the companies are called on by their id and the ratings are in a column called "ratings
 
Code:
"select avg(ratings) from reviews where id=2"

unless the id is based on user input or is a variable and then it would be:

Code:
"select avg(ratings) from reviews where id=" & id & ""
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top