Rabbe
08-12-2012, 12:06 PM
I have this as a function:
function highscore() {
$sql = mysql_query("SELECT * FROM `flaxer` ORDER BY `profit` DESC");
if (mysql_num_rows($sql) <= 0) {
echo "No entries!";
} else {
echo ("User:\tXp Gained:\tSpun:\t picked:\tprofit:\tRuntime:\trank");
$rank = 1;
while ($row = mysql_fetch_assoc($sql)) {
$username = $row['user'];
$xpgained = $row['xpgained'];
$spun = $row['spun'];
$picked = $row['picked'];
$profit = $row['profit'];
$runtime = $row['timerun'];
$user_rank = $rank;
echo('<table border=1 width=300>');
echo('<col width=150>');
echo('<col width=70>');
echo('<col width=70>');
echo('<tr>');
echo('<td>'.$username.'</td>');
echo('<td>'.$xpgained.'</td>');
echo('<td>'.$spun.'</td>');
echo('<td>'.$picked.'</td>');
echo('<td>'.format($profit).'</td>');
echo('<td>'.formatTime($runtime).'</td>');
echo('<td>'.$user_rank.'</td>');
echo('</tr>');
echo('</table>');
$rank++;
}
}
}
which displays a high-score table with ranks etc. But I want to use the rank on the dynamic signature.
this is in another document, so how would I go about calling the rank because $user_rank doesn't work
ImageTTFText($image, 30, 1, 510, 200, $color, $font, $user_rank);
function highscore() {
$sql = mysql_query("SELECT * FROM `flaxer` ORDER BY `profit` DESC");
if (mysql_num_rows($sql) <= 0) {
echo "No entries!";
} else {
echo ("User:\tXp Gained:\tSpun:\t picked:\tprofit:\tRuntime:\trank");
$rank = 1;
while ($row = mysql_fetch_assoc($sql)) {
$username = $row['user'];
$xpgained = $row['xpgained'];
$spun = $row['spun'];
$picked = $row['picked'];
$profit = $row['profit'];
$runtime = $row['timerun'];
$user_rank = $rank;
echo('<table border=1 width=300>');
echo('<col width=150>');
echo('<col width=70>');
echo('<col width=70>');
echo('<tr>');
echo('<td>'.$username.'</td>');
echo('<td>'.$xpgained.'</td>');
echo('<td>'.$spun.'</td>');
echo('<td>'.$picked.'</td>');
echo('<td>'.format($profit).'</td>');
echo('<td>'.formatTime($runtime).'</td>');
echo('<td>'.$user_rank.'</td>');
echo('</tr>');
echo('</table>');
$rank++;
}
}
}
which displays a high-score table with ranks etc. But I want to use the rank on the dynamic signature.
this is in another document, so how would I go about calling the rank because $user_rank doesn't work
ImageTTFText($image, 30, 1, 510, 200, $color, $font, $user_rank);