Jump to content

PHP MySQL Query Issue


chaser21

Recommended Posts

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

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.