Forum Moderators: coopster

Message Too Old, No Replies

I get error with this code

         

winpeace

9:03 pm on Nov 29, 2006 (gmt 0)

10+ Year Member



I get this error
Warning: Invalid argument supplied for foreach() in /home/content/a/a/s/aas/html/modules/mod_jw_ajaxnf.php on line 217
Error fetching remote content file!

215-231 lines
$html2out = array();

foreach ( $rows as $row ) {
if ($where == 'section' OR $where == 'category' OR $where == 'content') {
$Itemid = $mainframe->getItemid( $row->id, 0, 0, $bs, $bc, $gbs );

// Blank itemid check for SEF
if ($Itemid == NULL) {
$Itemid = '';
} else {
$Itemid = '&Itemid='.$Itemid;
}

$link = sefRelToAbs( 'index.php?option=com_content&task=view&id='. $row->id . $Itemid );
} else {
$link = $row->link;
}

eelixduppy

9:27 pm on Nov 29, 2006 (gmt 0)



"$rows" isn't an array. Refer to foreach [us2.php.net] documentation. You may want to check if it's an array like this:

if([url=http://us2.php.net/manual/en/function.is-array.php]is_array[/url]($rows)) {
echo 'Is array!';
} else {
echo 'Not array!';
}

Good luck!