• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why this error appears stdClass::$pic_item?

#1
site/views/index.php


          <?php foreach($pic as $pic_item): ?>
          <img src="<?php echo base_url('assets1/images/slider/'.$pic_item->pic_item );?>">                   
          <?php endforeach;?>


controllers/Cspages.php

  1.     public function index()    {                $this->load->helper('url');                $this->load->model('gallery_model');                $pic_unique_id = 18;  // slider                $data['pic'] = $this->gallery_model->get_picture($pic_unique_id);                            $this->load->view('index', $data);    }
models/Gallery_model.php


  1. public function get_picture($pic_unique_id)    {                      $query = $this->db->get_where('galleries_pictures', array('picture_unique_id' => $pic_unique_id));        return $query->result();         }
Hello,

How to handle this error message?


A PHP Error was encountered
Severity: Notice
Message: Undefined property: stdClass::$pic_item
Filename: views/index.php
Line Number: 214
Backtrace:
File: C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\masterlinkci2\application\site\views\index.php Line: 214 Function: _error_handler
File: C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\masterlinkci2\application\site\controllers\Cspages.php Line: 31 Function: view
File: C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\masterlinkci2\index.php Line: 315 Function: require_once
http://localhost/masterlinkci2/assets1/images/slider/"> }


views/index.php

Line Number: 214


<img src="<?php echo base_url('assets1/images/slider/'.$pic_item->pic_item );?>">
" If I looks more intelligence please increase my reputation."
Reply


Messages In This Thread
Why this error appears stdClass::$pic_item? - by davy_yg - 01-22-2017, 08:51 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.