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

[eluser]Bl4cKWid0w[/eluser]
I have a bunch of functions on this page. When I visit a certain function, I get an error that says:
Quote:You must use the "set" method to update an entry.

This error only occurs when I visit this function, however, this function doesn't update any database entries. It only inserts new information into the database. And it doesn't occur when I visit functions that do update database information.

It does not say which line of the file the error is occurring on, so this makes it even more difficult to fix.

Any ideas?
#2

[eluser]Elliot Haughin[/eluser]
It's because you're missing the second parameter in you're update line:

Code:
$this->db->where('post', $post_id);
$this->db->update('posts');

Should be:

Code:
$new_stuff = array('title' => 'New cool title');
$this->db->where('post', $post_id);
$this->db->update('posts', $new_stuff);

At least I think so... it's late, I'm tired, and I've had a couple of beers... so double check the active record docs.




Theme © iAndrew 2016 - Forum software by © MyBB