Part of the EllisLab Network
   
 
Error 1054
Posted: 09 June 2008 01:12 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  33
Joined  03-18-2008

Can anyone tell me what this means?

Error Number: 1054

Unknown column ‘_ci_scaffolding’ in ‘field list’

UPDATE usercomment SET _ci_scaffolding = 1, _ci_scaff_table = ‘usercomment’, id = NULL, fname = NULL, lname = NULL, email = NULL, comment = NULL WHERE 0 = ‘id’ AND 1

Profile
 
 
Posted: 09 June 2008 06:41 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  865
Joined  09-25-2007

http://codeigniter.com/forums/viewthread/46694/

The problem with the models userguide section is that it suggests to pass $this to the update, however when you pass this you are also passing _ci_scaffolding to the insert, as extending from model includes these values for scaffoliding.

so do not pass $this to any active record functions, it is bad practice

documentation example

function update_entry()
{
    
// yuck yuck as this->_ci_scaffolding will exist and try to insert/update 
    // it into the database as a column name.
    
$this->title   $_POST['title'];
    
$this->content $_POST['content'];
    
$this->date    time();

    
$this->db->update('entries'$this, array('id'$_POST['id']));


SO instead of doing the above you can do

function update_entry()
{
    $data 
= array(
               
'title' => $_POST['title'],
               
'content' => $_POST['content'],
             );

    
$this->db->where('id'$_POST['id']);
    
$this->db->update('entries'$data);
Profile