Welcome to WebmasterWorld Guest from 54.158.36.59

Forum Moderators: phranque

Message Too Old, No Replies

MYSQL to php export

sorted by hight

     
1:50 pm on Jul 8, 2010 (gmt 0)



Hi,

I'm coding a ranking for my homepage and now I got a problem with the max:
$result = mysql_query("SELECT * FROM ranking ORDER BY points DESC")or die(mysql_error());


It is quite working, but in the end the result is, that there is no echo of the maximum itself.

example:
NAME  POINTS
person1 125
person2 121
person3 123
person4 122
person5 124


the output would look like:

person5 124
person3 123
person4 122
person2 121


how to get an output of the maximum itself?

thanks in advance
Hendrik
2:14 pm on Jul 8, 2010 (gmt 0)

5+ Year Member



Check your iternation. You are skipping first row in while loop.
Try
while ($row = @mysql_fetch_array($result)){
echo $row[put your field here];
}
5:04 pm on Jul 8, 2010 (gmt 0)



oh sweet, thx!

Hendrik
7:19 pm on Jul 8, 2010 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld [webmasterworld.com], Hendrik!

it is also worth noting that the array index starts at 0, not 1, and that may help explain what you are seeing.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month