2017-04-26 28 views
0

我在MySQL dB中有一個鏈接到我的codeigniter項目的表。我保留字段'aboutus_detail'的varchar [1000]的數據類型,其中我存儲了一段很長的段落。當我嘗試從表中檢索數據時,我並沒有將整個數據存儲在字段'aboutus_detail'中。從MySQL表中沒有檢索到整個數據

The Length of the 'aboutus_detail' is varchar[1000]

The data stored for the 'aboutus_detail'

我已經使用的print_r()。我只得到以下輸出:

Array (
[0] => Array (
     [aboutus_id] => 1 
     [aboutus_title] => India Nirman Sangh 
     [aboutus_detail] => Since 2005, we have been working in the hills around Kodaikanal and Palaniin Tamilnadu, India.Through these twelve years, we have workedtowards women’s development in the towns on the hills,and in Kodaikanal and Palani towns. Winning th 
     [aboutus_image] => files/slide1.jpg 
      ) 
    ) 

我試過用數據類型作爲'文本'。建議一種方式,以便我可以檢索整個段落。

我的控制器:

class Welcome extends My_Controller { 

    public function index() 
{ 
    $this->load->model('aboutus_model'); 
    $data['list'] = $this->aboutus_model->about_us_page(); 
    $this->load->view('about_us/about',$data); 
    } 
} 

我的模型:

class Aboutus_model extends CI_Model 
{ 
    public function about_us_page() 
    { 
     $data = $this->db->query('select * from ins_aboutus')->result_array(); 
     return $data; 
    } 

} 

我的觀點:

<?php print_r($list); exit; ?> 
+0

全部得到保存? –

+1

嘗試使用數據類型'LONGTEXT'這是存儲高達4 Gib –

+0

添加代碼以及 –

回答

0

嘗試使用此代碼模型.......

class Aboutus_model extends CI_Model 
    { 
     public function about_us_page() 
     { 

    $data = $this->db->query('select * from ins_aboutus'); 
     return $data->result(); 

    } 

}