Im trying to load images from the database, i can get the full string and no display on the image and when i use the full array I get a array message.
here is the model :
public function get_webstore($webstore_id = '') {
/* get video */
if (empty($webstore_id)) {
$webstores = $this->get('webstore');
} else {
$webstores = $this->get('webstore', $webstore_id);
}
$webstore_array = array();
foreach ($webstores as $webstore) {
$singleWebstorePair = array();
if (!empty($webstore['images'])) {
$allWebstores = unserialize($webstore['images']);
foreach ($allWebstores as $allWestores) {
$singleWebstorePair[] = str_replace("./", "", base_url($allWebstores));
}
}
$webstore_array[] = array(
'id' => $webstore['id'],
'title' => $webstore['title'],
'content' => $webstore['content'],
'images' => $singleWebstorePair,
'created' => $webstore['created']
);
}
return $webstore_array;
}
and here is the front end code
<div class="col-md-12" style="height: 225px;">
<div class="col-md-4 text-center thumbnail123">
<img class="thumbnail" width="225px" src="<?php echo $webstore['images']?>.jpg"/>
<h3><?php echo $webstore['title']; ?></h3>
<p>Date Added: <?php echo date('d-m-y', strtotime($webstore['created'])) ?></p>
<hr>
<hr>
</div>
here is the controller if needed:
public function __construct() {
parent::__construct();
$this->load->model("post");
$this->load->database();
$this->load->helper("url");
}
public function index() {
$this->data['posts'] = $this->post->get_webstore($limit=null, $offset=null); // calling Post model method getPosts()
$this->data['page_title'] = 'Store';
$this->layout("pages/webstore", $this->data);
and the error:
Severity: Notice
Message: Array to string conversion
Filename: pages/webstore.php
Line Number: 45
thanks guys