chaser21 Posted March 4, 2010 Share Posted March 4, 2010 For some reason I cant seem to get the query right to get the results I want. Heres a background about the database. It is a stat tracking database for a fantasy golf game. Currently I have it set up with 5 different tables: Table -- Fields golfers -- id,firstname,lastname players -- id, alias scores -- id, golfer(relates to golfer ID), tour(relates to tour ID), score(the score they received for that tour) selections -- id, player(relates to player ID), golfer(related to golfer ID) tours -- id,date,name What I am trying to do is come up with an sql query that will give me the player and total score. Total score is based upon x number of selections of golfers and their total point for all the tours they have played in I have: SELECT players.alias, SUM(scores.score), selections.golfer, selections.player FROM `golfers`,players,scores,selections GROUP BY players.alias Im sorry if im doing this 100% wrong im fairly new to PHP and MySQL Link to comment https://forums.phpfreaks.com/topic/194109-php-mysql-query-issue/ Share on other sites More sharing options...
Rustywolf Posted March 4, 2010 Share Posted March 4, 2010 Youll need different queries im pretty sure you have to have a different query for each table. Link to comment https://forums.phpfreaks.com/topic/194109-php-mysql-query-issue/#findComment-1021306 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.