The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

php scripting issue

View previous topic View next topic Go down

In progress php scripting issue

Post by Mikielabdullah on February 24th 2013, 1:28 pm

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

Mikielabdullah
Forumember

Posts : 44
Reputation : 1
Language : english

Back to top Go down

In progress Re: php scripting issue

Post by Neymar1 on February 24th 2013, 3:52 pm

You can't use PHP on Forumotion.

Neymar1
Forumember

Male Posts : 406
Reputation : 27
Language : HTML, CSS, and a bit of JavaScript
Location : Scotland

http://www.simplyfifa.com

Back to top Go down

In progress Re: php scripting issue

Post by Mikielabdullah on February 24th 2013, 4:11 pm

what are you talking about man, my website is php based -_-

Mikielabdullah
Forumember

Posts : 44
Reputation : 1
Language : english

Back to top Go down

In progress Re: php scripting issue

Post by Base on February 24th 2013, 4:18 pm

Forumotion does not support PHP. Is your website with Forumotion? Can you please post a link to your forum?

Base
Forumaster

Male Posts : 10386
Reputation : 1687
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

Back to top Go down

In progress Re: php scripting issue

Post by Mikielabdullah on February 24th 2013, 5:02 pm


Mikielabdullah
Forumember

Posts : 44
Reputation : 1
Language : english

Back to top Go down

In progress Re: php scripting issue

Post by Neymar1 on February 24th 2013, 6:51 pm

You're on Forumotion. You can't use PHP. Unless you're doing all this on an external server or something?

Neymar1
Forumember

Male Posts : 406
Reputation : 27
Language : HTML, CSS, and a bit of JavaScript
Location : Scotland

http://www.simplyfifa.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum