Fantasy Points

Hello, trying to get some guidance on the php function. On line 333 I get Call to a member function fields() on a non-object in, which is $total_value=$fantasy_rs->fields(“total_value”);

Here is the snippet of the code

$players_ID=$rs->fields(“ID”);
$total_value=0;
$sql=“select sum(fantasy_value) as total_value from players_statistics_fantasy where players_ID=’$players_ID’ and leagues_ID=$LEAGUEID and year_ID=$year;”;
$fantasy_rs=$DB->Execute($sql);
$total_value=$fantasy_rs->fields(“total_value”);
$players_array[$players_ID]=$total_value;
$rs->MoveNext();

You are not fetching the data
[php]$fantasy_rs=$DB->Execute($sql); // <-- you don’t need to assign this to a variable
// here should be some sort of fetching of the data
$total_value=$fantasy_rs->fields(“total_value”);[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service