Call to undefined function
Posted: Mon Jan 11, 2010 9:58 pm
Hello, i cant seem to find the error in this code..
http://www.xgs-gaming.com/tlt/files/lad ... /index.php
<?php
include("functions.php");
$results = mysql_query("SELECT * FROM ladder_users");
$pos = 0;
while($row = mysql_fetch_array($results)) {
$pos += 1;
echo "
<tr>
<td width='39px'>#".$pos."</td>
<td width='43px'><img class='standings' src='images/ranks/".$row['Rank'].".jpg' border='0' /></td>
<td width='29px'><img class='standings' width='25px' height='17px' src='images/flags/".$row['Nationality'].".gif' border='0' alt='".$row['Nationality']."' /></td>
<td width='106px'><img class='standings' src='images/characters/".$row['Mchar'].".jpg' border='0' /></td>
<td width='159px'>".$row['Username']."</td>
<td width='40px'>".$row['Points']."</td>
<td width='71px'>".$row['Win']." - ".$row['Loss']."</td>
<td width='67px'>".win_ratio($row['Win'],$row['Loss'])."%</td>
</tr>
";
}
?>
This is whats inside functions.php :
function win_ratio($win,$loss) {
if ($loss == 0) {
return 100;
}
else if ($win == 0) {
return 0;
}
else {
$ratio = (($win/($win+$loss))*100);
return round($ratio, 2);
}
}
http://www.xgs-gaming.com/tlt/files/lad ... /index.php
<?php
include("functions.php");
$results = mysql_query("SELECT * FROM ladder_users");
$pos = 0;
while($row = mysql_fetch_array($results)) {
$pos += 1;
echo "
<tr>
<td width='39px'>#".$pos."</td>
<td width='43px'><img class='standings' src='images/ranks/".$row['Rank'].".jpg' border='0' /></td>
<td width='29px'><img class='standings' width='25px' height='17px' src='images/flags/".$row['Nationality'].".gif' border='0' alt='".$row['Nationality']."' /></td>
<td width='106px'><img class='standings' src='images/characters/".$row['Mchar'].".jpg' border='0' /></td>
<td width='159px'>".$row['Username']."</td>
<td width='40px'>".$row['Points']."</td>
<td width='71px'>".$row['Win']." - ".$row['Loss']."</td>
<td width='67px'>".win_ratio($row['Win'],$row['Loss'])."%</td>
</tr>
";
}
?>
This is whats inside functions.php :
function win_ratio($win,$loss) {
if ($loss == 0) {
return 100;
}
else if ($win == 0) {
return 0;
}
else {
$ratio = (($win/($win+$loss))*100);
return round($ratio, 2);
}
}