php scripting issue
3 posters
Page 1 of 1
php scripting issue
i am running php3 and i am trying to create a killboard on a custom page. Please help me, this is the script being used..
<?php
if (($_REQUEST['month'] == 99) || (!$_REQUEST['month'])) {
$month = date("m");
}
if (($_REQUEST['year'] == 9999) || (!$_REQUEST['year'])) {
$year = date("Y");
}
?>
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="box">
<?php
$top_scorers = array();
$query_users = "SELECT callsign,rank FROM users ORDER BY callsign";
$result_users = mysql_query($query_users) or die("Query Failed: ".mysql_error());
while ($line = mysql_fetch_array($result_users)) {
$callsign = $line['callsign'];
$total = 0;
$query_scores = "SELECT total FROM reports WHERE callsign='$callsign' AND MONTH(date)=$month AND YEAR(date)=$year";
$result_scores = mysql_query($query_scores) or die("Query Failed: ".mysql_error());
while ($line = mysql_fetch_array($result_scores)) {
$total_score = $line['total'];
$total += $total_score;
}
$top_scorers[$callsign] = $total;
}
arsort($top_scorers);
foreach ($top_scorers as $key => $val) {
$i = 0;
foreach ($top_scorers as $key => $val) {
if ($val != 0) {
$query_rank = "SELECT rank FROM users WHERE callsign='$key'";
$result_rank = mysql_query($query_rank) or die("Query Failed: ".mysql_error());
while ($line = mysql_fetch_array($result_rank)) {
$rank = $line['rank'];
}
echo "<tr>";
echo " <td align='left'>$rank ".ucwords($key)."</td>";
echo " <td align='right'>".number_format($val)."</td>";
echo "</tr>";
if(++$i > 9) break;
}
}
?>
</table>
i am trying to get it to display a Killboard that will show me the stats of each player who added a point/kill to the board
<?php
if (($_REQUEST['month'] == 99) || (!$_REQUEST['month'])) {
$month = date("m");
}
if (($_REQUEST['year'] == 9999) || (!$_REQUEST['year'])) {
$year = date("Y");
}
?>
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="box">
<?php
$top_scorers = array();
$query_users = "SELECT callsign,rank FROM users ORDER BY callsign";
$result_users = mysql_query($query_users) or die("Query Failed: ".mysql_error());
while ($line = mysql_fetch_array($result_users)) {
$callsign = $line['callsign'];
$total = 0;
$query_scores = "SELECT total FROM reports WHERE callsign='$callsign' AND MONTH(date)=$month AND YEAR(date)=$year";
$result_scores = mysql_query($query_scores) or die("Query Failed: ".mysql_error());
while ($line = mysql_fetch_array($result_scores)) {
$total_score = $line['total'];
$total += $total_score;
}
$top_scorers[$callsign] = $total;
}
arsort($top_scorers);
foreach ($top_scorers as $key => $val) {
$i = 0;
foreach ($top_scorers as $key => $val) {
if ($val != 0) {
$query_rank = "SELECT rank FROM users WHERE callsign='$key'";
$result_rank = mysql_query($query_rank) or die("Query Failed: ".mysql_error());
while ($line = mysql_fetch_array($result_rank)) {
$rank = $line['rank'];
}
echo "<tr>";
echo " <td align='left'>$rank ".ucwords($key)."</td>";
echo " <td align='right'>".number_format($val)."</td>";
echo "</tr>";
if(++$i > 9) break;
}
}
?>
</table>
i am trying to get it to display a Killboard that will show me the stats of each player who added a point/kill to the board
Mikielabdullah- Forumember
- Posts : 44
Reputation : 1
Language : english
Re: php scripting issue
what are you talking about man, my website is php based -_-
Mikielabdullah- Forumember
- Posts : 44
Reputation : 1
Language : english
Re: php scripting issue
Forumotion does not support PHP. Is your website with Forumotion? Can you please post a link to your forum?
Mikielabdullah- Forumember
- Posts : 44
Reputation : 1
Language : english
Re: php scripting issue
You're on Forumotion. You can't use PHP. Unless you're doing all this on an external server or something?
Similar topics
» Scripting Issue
» Scripting
» i need help scripting really fast please
» A few scripting problems!
» HAVING SCRIPTING PROBLEMZ
» Scripting
» i need help scripting really fast please
» A few scripting problems!
» HAVING SCRIPTING PROBLEMZ
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum