title: updating a field in DB table using Codeigniter
body: <p>I have two tables one is 'student' another is 'status'.The student table has a foreign key status_status_id. I want to update this status_status_field. In my view the all the status (junior, senior, fresher, sophomore) from the status are shown in a drop down menu.</p>
  
  <p>I want to update the status_status_id (initially it has the value 0) field of student table by taking inputs from this drop down. And to update i also need the id of a particular student. The problem is the field status_status_id is not updating. The following error is showing-</p>
  
  <pre><code>       A Database Error Occurred
  
          Error Number: 1054
  
        Unknown column 'Array' in 'where clause'
  
          UPDATE `student` SET `0` = '' WHERE `id` = Array
  
         Filename: Z:\www\CI\system\database\DB_driver.php
  
       Line Number: 330
  </code></pre>
  
  <p>my controller</p>
  
  <pre><code> function update(){
   $id=$this-&gt;input-&gt;post('id');
   $data=array(
   'status_status_id'=&gt;$this-&gt;input-&gt;post('status_status_id'),
   );
   $this-&gt;status_model-&gt;update($data, $id);
   }
  }
  </code></pre>
  
  <p>my model</p>
  
  <pre><code>function update($data,$id){
  
   $this-&gt;db-&gt;where('id', $id);
   $this-&gt;db-&gt;update('student', $data);
  }
          }
  </code></pre>
  
  <p>View for adding a status</p>
  
  <pre><code>   &lt;?php echo form_open('status_controller/update'); 
      $r=$info[0]-&gt;id;
    $data=array (
    'id'=&gt;$r,
   'status_status_id'=&gt;set_value('status_status_id')
             );
            ?&gt;
            &lt;p&gt;&lt;?php echo form_input($data); ?&gt;
          &lt;p&gt;&lt;select name ='status_status_id'&gt;
         &lt;?php echo form_error('status_status_id'); ?&gt;
          &lt;br /&gt;&lt;?php
      $getType = mysql_query("SELECT status_id, status FROM status ORDER BY status_id");
        while($type = mysql_fetch_object($getType)){
      echo "&lt;option value=\"{$type-&gt;status_id}\"&gt;{$type-&gt;status} &lt;/option&gt;",set_value('status_status_id');
  } ?&gt;&lt;/p&gt;&lt;p&gt;&lt;?php echo form_submit( 'submit', 'Update Status'); ?&gt;&lt;/p&gt;&lt;?php echo form_close(); ?&gt;
  </code></pre>