title: codeigniter insert data into database with enum field
body: <p>I'm having an issue when creating/inserting data into the db. Whenever I submit the form it returns an error using form_validation. It works with my previous database but now it doesn't. I doubt it's on the data type enum.</p>
  
  <p>controller:</p>
  
  <pre><code>public function create_item() {
    $data = array(
     'checklist_id' =&gt; $this-&gt;input-&gt;post('checklist_id'),
     'title' =&gt; $this-&gt;input-&gt;post('title'),
     'description' =&gt; $this-&gt;input-&gt;post('description'),
     'type'  =&gt; $this-&gt;input-&gt;post('type'), //with enum type
     'section' =&gt; $this-&gt;input-&gt;post('section'),
     'order_no' =&gt; $this-&gt;input-&gt;post('order_no'),
     'status' =&gt; $this-&gt;input-&gt;post('status'), //with enum type
     'date_created' =&gt; $this-&gt;input-&gt;post('date_created')
     );
  
    $this-&gt;form_validation-&gt;set_rules('title','Item Title','trim|required|callback_alpha_dash_space');
    $this-&gt;form_validation-&gt;set_rules('order_no','Item Order','trim|required');
  
    $this-&gt;form_validation-&gt;set_message('alpha_dash_space', '%s appears to be invalid. Must contain only alphabets.');
    $this-&gt;form_validation-&gt;set_message('required', '%s field must not be empty. ');
  
    if ($this-&gt;form_validation-&gt;run() == FALSE) {
      $this-&gt;session-&gt;set_flashdata('error', ' Error adding an item!');
      redirect($this-&gt;agent-&gt;referrer());
    } else {
        $result = $this-&gt;checklist_item_model-&gt;put_item($data);
          if (!$result == TRUE) {
          $this-&gt;session-&gt;set_flashdata('success', 'Item added successfuly!');
          redirect('checklist_item', 'refresh');
        }
      }
   }
  </code></pre>
  
  <p>view:</p>
  
  <pre><code>&lt;select class="form-control" id="status" name="status"&gt;
    &lt;option value="0"&gt;Incomplete&lt;/option&gt;
    &lt;option value="1"&gt;Complete&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>