<?php
$leaders = mysql_query('SELECT * FROM `playerstats` WHERE `Season_ID` = 12 ORDER BY `playerstats`.`ProPoint` DESC LIMIT 0, 1');
while ($leader = mysql_fetch_assoc($leaders)) {
$leadername = $leader[Name];
$leaderphotos = mysql_query('SELECT * FROM `players` WHERE `Name` = $leadername LIMIT 0, 1 ');
$leaderphoto = $leaderphotos[Photo];
echo ''.$leaderphoto.'';
echo '<img src=http://www.vhlsim.net/image/players/'.$leaderphoto.'><br><font size=4><b>'.$leadername.'</b></font><br><br>';
}
echo '<table border="1" align=center cellpadding="2" cellspacing="3" width="180">
<tr><th>Name</th><th>G</th><th>A</th><th>P</th></tr>';
$players = mysql_query('SELECT * FROM `playerstats` WHERE `Season_ID` = 12 ORDER BY `playerstats`.`ProPoint` DESC LIMIT 1, 9');
while ($player = mysql_fetch_assoc($players)) {
echo '<tr><td>'.$player['Name'].'</td><td>'.$player['ProG'].'</td><td>'.$player['ProA'].'</td><td>'.$player['ProPoint'].'</td></tr>';
}
echo '</table>';
?>
the chart works fine, but i want the table to print the name and photo of the top scorer above the chart. $leaderphoto should correspond to "Ryan Getzlaf.jpg", which is the player photo for peyton nydroj, the current leading scorer. however, the value of $leaderphoto is being returned as null.
i'm sure this is very poor code and that there's a more efficient way to do this ,but if anyone happens to be good at php and sees where i am going wrong, let me know.


