By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,830 Members | 2,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,830 IT Pros & Developers. It's quick & easy.

HELP. Position in row query

P: 7
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.
Expand|Select|Wrap|Line Numbers
  1. Select sum(score1+score2) from whatever table
  2.  
  3. $x=0
  4. while($row = mysql_fetch_array($result) {
  5. if ($user == $row['user']) {
  6. echo "$user is rank $x out of " . count($result);
  7. break;
  8. } else {
  9. $x++
  10. }
  11. }
  12.  
  13.  
but i am not getting desired result. need help
Oct 28 '08 #1
Share this Question
Share on Google+
2 Replies


code green
Expert 100+
P: 1,726
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
Oct 29 '08 #2

Markus
Expert 5K+
P: 6,050
Bakbai, please read the Posting Guidelines on Homework.

Markus.
Oct 29 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.