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);
}
}
Call to undefined function
Moderator: General Moderators
- SimpleManWeb
- Forum Commoner
- Posts: 57
- Joined: Wed Dec 30, 2009 4:15 pm
- Location: New Hampshire, USA
Re: Call to undefined function
Change your include (functions.php) to require (functions.php). I bet you will find that the file is not being included. I couldn't find any errors in your code, so it has to be that it isn't getting the file correctly.
Re: Call to undefined function
And you want us to do it for you? You going to give us something to start from?insei wrote:Hello, i cant seem to find the error in this code..
Re: Call to undefined function
im sorry my bad... I was stupid enough to forget the php tags inside the functions.php.tasairis wrote:And you want us to do it for you? You going to give us something to start from?insei wrote:Hello, i cant seem to find the error in this code..
Thanks alot for the replies, really apriciate it.