SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Error Help

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Oct 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error Help

    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


    PHP Code:
    <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(000$c10));
                                        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-->
    Last edited by cpradio; Oct 7, 2013 at 08:10. Reason: removed useless localhost link


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •