我有我的控制器此功能:笨解析變量查看 - 消息:數組字符串轉換
public function simpan() {
$this->load->library('form_validation');
// field name, error message, validation rules
$this->form_validation->set_rules('name', 'User Name', 'trim|required|min_length[4]|xss_clean');
$this->form_validation->set_rules('email', 'Your Email', 'trim|required|valid_email');
$this->form_validation->set_rules('message', 'Your Message', 'trim|required');
if ($this->form_validation->run() == FALSE) {
$data['msg_save'] = "data not saved";
$this->load->view("v_bukutamu, $data");
} else {
$this->m_bukutamu->simpan();
$data['msg_save'] = "data saved";
$this->load->view("v_bukutamu, $data");
}
}
而此行以觀解析varible $ msg_save:
<p><?php if (isset($msg_save)) echo $msg_save; ?></p>
數據已成功保存到數據庫,但它給了我這個錯誤信息:
我只是想用相同的視圖顯示成功或失敗的消息。 有沒有人有任何想法我應該改變我的腳本?
Antoher of my typos ..謝謝all .. – wahyueka31