HELP. Position in row query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bakbai
    New Member
    • Oct 2008
    • 7

    HELP. Position in row query

    what i need is how to sum two or more columns with mysql and let php determine the the highest and lowest, by given it sum a position.
    here is my code which i earlier tried.
    [code=php]
    Select sum(score1+scor e2) from whatever table

    $x=0
    while($row = mysql_fetch_arr ay($result) {
    if ($user == $row['user']) {
    echo "$user is rank $x out of " . count($result);
    break;
    } else {
    $x++
    }
    }

    [/code]
    but i am not getting desired result. need help
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    I believe this is a piece of sudo-code supplied by your tutor as a basis to produce an assignment.
    here is my code which i earlier tried
    You need to try harder

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Bakbai, please read the Posting Guidelines on Homework.

      Markus.

      Comment

      Working...