Jump to content

Sorting help


moon 111

Recommended Posts

I kind've need the help quickly....

Umm, you're getting free help from a public community, which members donate their free time to help.

 

Also in order to get you a faster reply would help if you posted your current query and posting your question within the correct board. PHP help is for PHP. Yours is related to MySQL (I presume) so I'll move this tread.

Link to comment
https://forums.phpfreaks.com/topic/97467-sorting-help/#findComment-498767
Share on other sites

I have a table sites that has the cols id, title, description, uid. I also have a table rating with the rows sid, uid, rating. sid reffers to the site. Now I want to sort 'sites' by the average of all of the ratings reffering to that site. This is a want I would do if I could (obviously not legal:

SELECT * FROM sites ORDER BY AVG(SELECT rating FROM rating WHERE sid = '".$sid."') DESC

.

 

Clear?

Link to comment
https://forums.phpfreaks.com/topic/97467-sorting-help/#findComment-498781
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.