codeIgniter でこの致命的なエラー メッセージが表示されます。同じ質問に対するいくつかの回答を既に試しました。
私はすでにphp.iniを設定しています
最大実行時間 = 300 最大入力時間 = 600 メモリ制限 = 128M
しかし、それでも同じ Fatal エラー メッセージが表示されます。問題がコードにあるのか、PHP 設定にあるのかわかりません。
コントローラーのコードの一部を次に示します。
public function blog(){
$this->load->model("blog_model");
$data["title"] = "CodeIgniter Projects - Blog";
if($this->getLastUrl() == 'blog'){
$data["result"] = $this->blog_model->getBlogs();
$this->load->view("view_blog", $data);
}else{
$blog_name = $this->getLastUrl();
$data["result"] = $this->blog_model->getBlogDetails($blog_name);
$data["comment"] = $this->blog_model->getBlogComments($blog_name);
$this->load->view("view_blog_details", $data);
//check for reply
$url =$_SERVER['REQUEST_URI'];
$getLast = explode("/", $url);
$last = end($getLast);
if($last == 'reply'){
$this->load->library('form_validation');
$this->form_validation->set_rules('name', 'Name',
'trim|required|min_length[4]|xss_clean');
$this->form_validation->set_rules('message', 'Comment',
'trim|required|min_length[4]|xss_clean');
$this->form_validation->set_rules('email', 'Email Address',
'trim|required|valid_email');
if($this->form_validation->run() == FALSE)
{
$this->blog();
}
else
{
$msg = 'Message sent.';
$this->blog_model->addBlogComment();
$this->blog();
}
}
}
}
私の主な機能は、ブログに新しいコメントを追加することです。機能しますが、データが重複して挿入され、致命的なエラー メッセージを取り除くことができません。
addBlogComment 関数
関数 addBlogComment(){ $data=配列( 'blog_id'=> $this->input->post('blog_id'), '名前' => $this->input->post('名前'), 'email' => $this->input->post('email'), 'メッセージ' => $this->input->post('メッセージ'), 'created' => date('Ymd H:i:s') ); $this->db->insert('comment',$data); }