2016-11-02 3 views
0

A PHPのエラーが発生しましたアレイ:56

重大度:注意

メッセージ:文字列への変換アレイ

ファイル名:ビュー/ editslideshows.php

行番号:56

バックトレース:

ファイル:C:\プログラムファイル\ EasyPHP-Devserver-16.1 \ EDS-WWW \ companygiondaci \アプリケーション\ビュー\のeditslideshows.php ライン:56 機能:_error_handler

ファイル:C:\プログラムファイル\ EasyPHP 310 機能:ビュー

ファイル:C:\プログラムファイル\ EasyPHP-Devserver-16.1 \ EDS-WWW \ companygiondaci \ -Devserver-16.1 \ EDS-WWW \ companygiondaci \アプリケーション\コントローラはCpages.php ラインを\しますindex.php 行:315 機能:require_once

あなたは、エコーを使用の

ビュー/ editslideshows.php

<?php foreach ($images as $images_item): ?> 
<?php echo $images; ?> 
<?php endforeach; ?> 

コントローラ/ Cpages.php

public function editslideshow() { 

    $image_id = $this->uri->segment(3); 

    $data['images'] = $this->Mpages->call_point_slideshow($image_id); 

    $this->load->view('editslideshows', $data); 

} 

モデル/ Mpages.php

public function call_point_slideshow($image_id) 
{ 
    $this->db->where('image_id', $image_id); 
    $query = $this->db->get('slideshow'); 
    return $query->result(); 

} 
+0

ください邸宅行番号:56 –

+0

これは良い読書はhttp:// WWWをそれだが、あなたのslideshowテーブル私の補正怒鳴る

から任意のフィールド名を意味しています。 codeigniter.com/user_guide/database/results.html – user4419336

答えて

2
あなたのビューページで

views/editslideshows.php

直接<?php echo $images; ?>ですtingエラー。

$images_item->db_field_nameを使用できます。あなたのビューで

<?php foreach ($images as $images_item): ?> 
<?php echo $images_item->db_field_name; ?> 
<?php endforeach; ?> 
2

<?php foreach ($images as $images_item) { ?> 

<h3><?php echo $images_item->field_name; ?></h3> 

<?php } ?>