I have uploaded an image through a form and successfully stored it in a uploads directory and I have also successfully stored the full path of the image in my database.
But I am facing a problem with showing the image in view :
view :
<div class="deal-top-top">
<?php foreach($getAll as $rec) { ?>
<div class="col-md-3 top-deal-top">
<div class=" top-deal">
<a href="single.html" class="mask"><img src="<?php echo base_url('upload/screenshoot/').$rec->ss;?>"class="img-responsive zoom-img" alt=""></a>
<span class="four"><?php echo $rec->data_kategori;?></span>
<div class="deal-bottom">
<div class="top-deal1">
<h5><a href="single.html"><?php echo $rec->nama_aplikasi;?></a></h5>
<p>Instansi: <?php echo $rec->nama_instansi;?></p>
</div>
<div class="top-deal2">
<a href="single.html" class="hvr-sweep-to-right more">More</a>
</div>
<div class="clearfix"> </div>
</div>
</div>
</div>
<?php } ?>
<div class="clearfix"> </div>
</div>
upload/screenshoot is uploads directory path, ss is the data name in database..
Controller
$this->load->view('produk_view',['getKategori' =>$getKategori,'getAll' =>$getAll]);
if test with array :
ss is the part of getAll query:
Array
(
[0] => stdClass Object
....
[ss] => 1487492623549.PNG
....
)
Error :
A PHP Error was encountered
Severity: Error
Message: Cannot use object of type stdClass as array
Thank you