Hello frens, i am currently working on a project and i got an error. I tried to troubleshoot but couldn’t do it. I have highlighted the error in red.
i am using codeigniter as a framework.
The error says:
A PHP Error was encountered
Severity: Notice
Message: Object of class stdClass could not be converted to int
Filename: views/news.php
Line Number: 189
<div class="span4 custom">
<div class="divHeader">
News Archive (2013)
</div>
<dl>
<?php
$currentMonth = date('m');
for ($c = $currentMonth; $c >= 1; $c--){
$all['month'.$c] = $this->news_model->get_by_month($c);
?>
<dt><?php
$monthName = date("F", mktime(0, 0, 0, $c, 10));
echo $monthName;
?>
</dt>
<dd>
<ul>
<?php
foreach ($all['month'.$c] as $values){
?>
<li>
<?php if(count($values > 0)){ ?>
<a href="<?php echo base_url() . 'news/news_detail/' . $values->new_id; ?>"><?php echo $values->new_title; ?></a>
<?php }else{ ?>
No data
<?php } ?>
</li>
<?php
}//foreach statement ends
?>
</ul>
</dd>
<?php
}//for statements ends
?>
</dl>
</div><!-- span 3-->