I have a similar error and can't figure it out. It obviously has something to do with the object being inside a function, because when I copy the function body and replace the function calls with the function body, it works fine. The error is for line 8 ($rs = $dbc...).
<?
include 'pheader.htm';
function getlistitems($item){
$formfield = "<select name=\"newval\">\n";
print $item;
$rs = $dbc->Execute("get_".$item) or DIE("Could not perform requested task. Please <a href=\"mailto:techsupport@nflc.org?subject=".$php_errormsg."\">contact the NFLC</a>.");
while(!$rs->EOF){
$formfield .= "<option value=".$rs->Fields["id"]->value.">".$rs->Fields[$item]->value."\n";
$rs->MoveNext();
}
$formfield .= "</select>";
}
if($submit){
$dbc->execute("update_learning_obj ".$loid.",".$item.",'".$newval."'");
print "\"".$item."\" has been changed.\n";
}
else{
switch($item){
case 'language':
getlistitems($item);
break;
case 'comp_level':
getlistitems($item);
break;
case 'topic':
getlistitems($item);
break;
default:
$formfield = "<input type=\"text\" name=\"newval\">";
}
print "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">\n
Change ".$item." from \"".$val."\" to: ".$formfield."<p>\n
<input type=\"submit\" name=\"submit\" value=\"Change\">\n
<input type=\"hidden\" name=\"item\" value=\"".$item."\">\n
<input type=\"hidden\" name=\"loid\" value=".$loid.">\n
<form>";
}
include 'pfooter.htm';
?>