Jump to content

brucevader

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

brucevader's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks a bunch, obsidian! I knew my problem could be fixed easily, but I just needed help finding exactly what the problem was. Apparently, the 'id' field was ambiguous, but it works fine now.
  2. I'm making a site with certain likenesses to imdb.com, but for dvds where people can enter their dvd collections as well as rate and comment the movies. I want to be able to display the titles as a "top ten" list, or at least show all of them ordered by their rating. However, this proved trickier than anticipated. I want the rating score to be a combined average of the users' ratings for both the movie itself and the dvd production values, with the movie rating twice as important. This calculated score is not stored in my database, but every single rating is stored in a table named opinion as the int values filmgrade and dvdgrade (1 to 5). After some failed attempts and follow-up research, I came up with a query that seemingly should return all dvds ordered by overall rating, but I still only get the warning message "mysql_fetch_object(): supplied argument is not a valid MySQL result resource". Can someone tell me what's wrong with my query? Here it is: SELECT id, title, edition, username, top.rating FROM DVD, ( SELECT id, (Avg(filmgrade)*2+Avg(dvdgrade))/3 AS rating FROM opinion GROUP BY id ) AS top WHERE DVD.id=top.id ORDER BY top.rating DESC Thanks
×
×
  • 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.