Error is Fatal error: Call to a member function on a non-object in .../public_html/modules/NS-Nascar/pndivisionsapi.php on line 181
Code
function Nascar_divisionsapi_get_topic($args){
extract($args);
// Get datbase setup - note that both pnDBGetConn() and pnDBGetTables()
// return arrays but we handle them differently. For pnDBGetConn()
// we currently just want the first item, which is the official
// database handle. For pnDBGetTables() we want to keep the entire
// tables array together for easy reference later on
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
// It's good practice to name the table and column definitions you
// are getting - $table and $column don't cut it in more complex
// modules
$topicstable = $pntable['topics'];
$topicscolumn = &$pntable['topics_column'];
$query = "SELECT $topicscolumn[tid],
$topicscolumn[topicname],
$topicscolumn[topicimage],
$topicscolumn[topictext]
FROM $topicstable
WHERE $topicscolumn[tid]=$topic";
$result = $dbconn->Execute($query);
LINE 181 for(; !$result->EOF; $result->MoveNext() ) {
list($tid, $tname, $timage, $ttext) = $result->fields;
$got_topic = array('tid' => $tid,
'tname' => $tname,
'timage' => $timage,
'ttext' =>$ttext);
}
return $got_topic;
}
?>
extract($args);
// Get datbase setup - note that both pnDBGetConn() and pnDBGetTables()
// return arrays but we handle them differently. For pnDBGetConn()
// we currently just want the first item, which is the official
// database handle. For pnDBGetTables() we want to keep the entire
// tables array together for easy reference later on
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
// It's good practice to name the table and column definitions you
// are getting - $table and $column don't cut it in more complex
// modules
$topicstable = $pntable['topics'];
$topicscolumn = &$pntable['topics_column'];
$query = "SELECT $topicscolumn[tid],
$topicscolumn[topicname],
$topicscolumn[topicimage],
$topicscolumn[topictext]
FROM $topicstable
WHERE $topicscolumn[tid]=$topic";
$result = $dbconn->Execute($query);
LINE 181 for(; !$result->EOF; $result->MoveNext() ) {
list($tid, $tname, $timage, $ttext) = $result->fields;
$got_topic = array('tid' => $tid,
'tname' => $tname,
'timage' => $timage,
'ttext' =>$ttext);
}
return $got_topic;
}
?>
