Please help. Cron crashes with the following error:

Fatal error: Cannot use object of type stdClass as array in /home/content/e/l/a/elazar/html/includes/common.inc(1647) : eval()'d code on line 12

if I insert print $code; exit; just before the eval call, I get the following:

$query="SELECT node.nid AS nid,
   node.title AS node_title,
   users.name AS users_name
 FROM drup_node node 
 INNER JOIN drup_users users ON node.uid = users.uid
 WHERE node.type in ('tech_article')
   ORDER BY users_name ASC";
$result=pager_query($query, $limit = 10, $element = 0, $count_query = NULL);
$uname="";
while($row=db_fetch_object($result)){
	if($row['users_name']!=$uname){
		if($uname!="") { echo '</ul>'; }
		echo '<a href="/user/'.$row['user_name'].'" title="Link to User">'.
			$row['user_name'].'</a>';
		echo '<ul>';
	}
	echo '<li><a href="/node/'.$row['nid'].'" title="Link to article">'.$row['node_title'].'</a></li>';
}
echo '</ul>';

... which certainly looks like my error-prone code, except that the code errors don't exist any longer, haven't for days. I truncated all of the cache tables in the database to no avail. I also disabled all my modules and checked all module .php files for ending tags.
Anyone who can shed light on this; I appreciate it SO MUCH!!!

Comments

si_odong’s picture

you define row as db_fetch_object($result) while you call its derivation with an array (ie. $row['user_name], $row['node_title']) instead of an object (ie. $row->user_name, $row->node_title). if you still want to call $row derivation in array, change $row=db_fetch_object($result) to $row=db_fetch_array($result).