Hi,
Trying to output a ladder of scores taken from a mysql db..
this is the part that is causing an exception - any help spotting the problem is appreciated.
($positions is an array of objects which consists of specific values such as points, wins, loss etc etc.
I'm trying to sort through the objects by points and output them to a ladder type format...
Am I better of using a key/value - where object is key and its points are the value, i can then do a sort from value?
thanks.
for($pass = 1 ; $pass < count($positions); $pass++){
for($i = 0; $i < count($positions) - 1;$i++){
$teamA = $positions[$i];
$teamB = $positions[$i+1];
//line 105 if($teamA->getPoints() < $teamB->getPoints()){
$hold = $teamA;
unset($positions[$i]);
array_push($positions,$i,$team😎;
unset($positions[$i+1]);
array_push($positions,$i+1,$hold);
}
}
}
Fatal error: Call to a member function getPoints() on a non-object in W:\www\viewLadder.php on line 105
I've tested this - it is an object... i did a quick test and getPoints() prints a value.