[eluser]Thorpe Obazee[/eluser]
Quote:Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\tuts\apps\models\comment_model.php:1)
I am having a problem with my project and this is because the this error. I posted the model in question but I still don't see the problem.
Code:
<?php
class Comment_model extends Model
{
function __construct()
{
parent::Model();
}
function save()
{
$db_array = array
(
'user_id' => $this->user_id,
'tutorial_id' => $this->tutorial_id,
'comment_message'=> $this->comment_message
);
$this->db->insert('comments',$db_array);
$this->db->set('comment_count', 'comment_count + 1', FALSE);
$this->db->where ('id', $this->tutorial_id);
$this->db->update('tutorials');
}
function view()
{
$this->db->select('users.user, comments.comment_message, comments.comment_posted, comments.id as comment_id');
$this->db->from('comments');
$this->db->join('users', 'users.id = comments.user_id');
$this->db->where('tutorial_id', $this->tutorial_id);
return $this->db->get();
}
}
?>