- Beranda
- Komunitas
- Tech
- Website, Webmaster, Webdeveloper
[Help] HTML error tolong di bantu donk master


TS
CoconutClub
[Help] HTML error tolong di bantu donk master
permisi master2 program
numpang nanya
sya slalu kena error
A PHP Error was encountered
Severity: Notice
Message: Undefined index: title
Filename: controllers/blog.php
Line Number: 66
dan
A PHP Error was encountered
Severity: Notice
Message: Undefined index: body
Filename: controllers/blog.php
Line Number: 67
mohon bantuannya master2 program
ni CONTROLLER
<?php
Class Blog extends CI_controller {
function Blog(){
parent::__construct();
$this->load->helper(array('url', 'form'
);
$this->load->helper('text'
;
$this->load->model('MEntries'
;
}
function index() {
$data['title'] = "Blog";
$data['heading'] = "Welcome To My Blog";
$data['query'] = $this->db->get('entries'
;
$this->load->view('blog_view', $data);
}
function comments() {
$data['title']= "Blog";
$data['heading']= "Post Comment";
$data['query'] = $this->db->get('comments'
;
$this->db->where('entry_id',$this->uri->segment(3));
$this->load->view('Comment_view', $data);
}
function comment_insert(){
$this->db->insert('comments', $_POST);
redirect('blog/comments/'.$_POST['entry_id']);
}
function message(){
$data['title']= "Blog";
$data['heading']= "Post Message";
$data['query'] = $this->db->get('entries'
;
$this->load->view('Message_view', $data);
}
function message_insert(){
$this->db->insert('entries', $_POST);
redirect('blog'
;
}
function delete(){
$id = $this->uri->segement(3);
$this->MEntries->delete($id);
redirect ('blog'
;
}
function update(){
$data = array(
'id' => $this->input->post('id'
,
'title' => $this->input->post('title'
,
'body' => $this->input->post('body'
);
$id = $this->input->post('id'
;
$this->load->model('MEntries'
;
$this->MEntries->update($id, $data);
redirect('blog/edit/','refresh'
;
}
function edit(){
$this->load->model('MEntries'
;
$id = $this->uri->segment(3);
$data['result'] = $this->MEntries->select($id);
$result = $this->MEntries->select($id);
$data['title'] = $result['title']; <------//line yg bermasalah
$data['body'] = $result['body']; <------//line yg bermasalah
$this->load->view('edit',$data);
}
}
?>
dan ini Modelnya
<?php
class MEntries extends CI_MODEL{
function add($data){
$query = $this->db->insert('user',$data);
}
function read()
{
$query = $this->db->get('blog'
;
if($query->num_rows() > 0)
{
foreach ($query->result() as $key) {
$data[] = $key;
}
}
return ($data);
}
function select($id){
$this->db->where('id', $id);
$query =$this->db->get_where('entries',array('id' => $id));
return $query->row_array();
}
function update(){
$data = array(
'id' => $this->input->post('id'
,
'title' => $this->input->post('title'
,
'body' => $this->input->post('body'
);
$this->db->where('id', $this->input->post('id'
);
$this->db->update('entries', $data);
}
function delete($id){
$this->db->where('id',$id);
$this->db->delete('entries'
;
}
}
?>
mohon bantuannya



numpang nanya
sya slalu kena error
Quote:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: title
Filename: controllers/blog.php
Line Number: 66
dan
Quote:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: body
Filename: controllers/blog.php
Line Number: 67
mohon bantuannya master2 program
ni CONTROLLER
Quote:
<?php
Class Blog extends CI_controller {
function Blog(){
parent::__construct();
$this->load->helper(array('url', 'form'

$this->load->helper('text'

$this->load->model('MEntries'

}
function index() {
$data['title'] = "Blog";
$data['heading'] = "Welcome To My Blog";
$data['query'] = $this->db->get('entries'

$this->load->view('blog_view', $data);
}
function comments() {
$data['title']= "Blog";
$data['heading']= "Post Comment";
$data['query'] = $this->db->get('comments'

$this->db->where('entry_id',$this->uri->segment(3));
$this->load->view('Comment_view', $data);
}
function comment_insert(){
$this->db->insert('comments', $_POST);
redirect('blog/comments/'.$_POST['entry_id']);
}
function message(){
$data['title']= "Blog";
$data['heading']= "Post Message";
$data['query'] = $this->db->get('entries'

$this->load->view('Message_view', $data);
}
function message_insert(){
$this->db->insert('entries', $_POST);
redirect('blog'

}
function delete(){
$id = $this->uri->segement(3);
$this->MEntries->delete($id);
redirect ('blog'

}
function update(){
$data = array(
'id' => $this->input->post('id'

'title' => $this->input->post('title'

'body' => $this->input->post('body'

$id = $this->input->post('id'

$this->load->model('MEntries'

$this->MEntries->update($id, $data);
redirect('blog/edit/','refresh'

}
function edit(){
$this->load->model('MEntries'

$id = $this->uri->segment(3);
$data['result'] = $this->MEntries->select($id);
$result = $this->MEntries->select($id);
$data['title'] = $result['title']; <------//line yg bermasalah
$data['body'] = $result['body']; <------//line yg bermasalah
$this->load->view('edit',$data);
}
}
?>
dan ini Modelnya
Quote:
<?php
class MEntries extends CI_MODEL{
function add($data){
$query = $this->db->insert('user',$data);
}
function read()
{
$query = $this->db->get('blog'

if($query->num_rows() > 0)
{
foreach ($query->result() as $key) {
$data[] = $key;
}
}
return ($data);
}
function select($id){
$this->db->where('id', $id);
$query =$this->db->get_where('entries',array('id' => $id));
return $query->row_array();
}
function update(){
$data = array(
'id' => $this->input->post('id'

'title' => $this->input->post('title'

'body' => $this->input->post('body'

$this->db->where('id', $this->input->post('id'

$this->db->update('entries', $data);
}
function delete($id){
$this->db->where('id',$id);
$this->db->delete('entries'

}
}
?>
mohon bantuannya



0
1.1K
Kutip
0
Balasan


Komentar yang asik ya


Komentar yang asik ya
Komunitas Pilihan