Jump to content

lunarbytes

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About lunarbytes

  • Rank
    Newbie
  1. Thanks. I found the answer using a different query and it now does what it supposed to do.
  2. I am trying to sum a column from a qurey using the top values only. Using the following line I get the result ( 7 top distance answer) for that column. $distance = mysql_query("SELECT distance FROM competition WHERE JPersonID=$row[iD] ORDER BY distance DESC LIMIT 7"); $row[iD] is from an earlier query so that only values related to the above query is called. As can be seen I order the result from highest to lowest limiting the result to 7 records. Now I need to add these results, to get a total distance. Using the 'SUM(distance) As xxx' does not give me the right result in the above query. (It
×
×
  • Create New...