Welcome Guest, Not a member yet? Register   Sign In
You must use the "set" method to update an entry.
#1

[eluser]Unknown[/eluser]
A Database Error Occurred

You must use the "set" method to update an entry.

I can't understand what the problem. I was doing everything like the tutorial sad.

Code:
function comment_insert()
    {
        
        $this->db->insert('comments', $_POST);
        
        redirect('blog/comments/' .$_POST['entry_id']);
    }
#2

[eluser]mi6crazyheart[/eluser]
What u r wanted to do ? insert any new record or update any existing record... ?
#3

[eluser]Unknown[/eluser]
Insert a new record. When I trying insert a new comment in blog, i get this error
#4

[eluser]mi6crazyheart[/eluser]
If u want to insert a new record, i hope u'r doing this in u'r model function then u'r MODEL function should be like this..

Code:
$this->db->set('commentContent', $this->session->userdata('comment')); //commentContent is DB table field name
$this->db->insert('user_comments');  //user_comments is the DB table name

Ref: http://ellislab.com/codeigniter/user-gui...tml#insert




Theme © iAndrew 2016 - Forum software by © MyBB