title: Error Number: 1064 in codeigniter
body: <p>I am getting this error when ever i am uploading a file and storing details in the database using codeigniter</p>
  
  <p>here is my controller</p>
  
  <pre><code>    public function sugsn_up()
  {
      if ( $this-&gt;session-&gt;userdata('login_state') == FALSE )
          $this-&gt;load-&gt;view('faculty/facultylog1_view');
      else
      {
      $config['upload_path'] = './suggestion/';
      $config['allowed_types'] = 'pdf|doc|docx|txt';
      $config['max_size'] = '10000000';
      $emp_id=$this-&gt;session-&gt;userdata('emp_id');          
      $this-&gt;load-&gt;library('upload', $config);
      $tname='subject_master';
          $res['sub']=$this-&gt;faculty_model-&gt;return_rec($tname);
          $tname='course_master';
          $res['crse']=$this-&gt;faculty_model-&gt;return_rec($tname);
      if ( ! $this-&gt;upload-&gt;do_upload())
      {
          $error = array('error' =&gt; $this-&gt;upload-&gt;display_errors());
          $this-&gt;load-&gt;view('faculty/up_sugsn', $error,$res);
      }
      else
      {
          $data = array('upload_data' =&gt; $this-&gt;upload-&gt;data());
          $path=base_url().'attendence/'.$data['upload_data']['file_name'];
          $sdata=array('sug_id'=&gt;NULL,
                   'emp_id'=&gt;$emp_id,
                   'sug_name'=&gt;$_POST['sugsn_name'],
                   'course_id'=&gt; $_POST['cid'],
                   'sub_id'=&gt; $_POST['sid'],
                   'link'=&gt;$path
                   );
                   $this-&gt;faculty_model-&gt;sugsn_up($sdata);
          $this-&gt;load-&gt;view('faculty/upload_success', $data);
      }
      }
  }
  </code></pre>
  
  <p>and this is my model</p>
  
  <pre><code>    public function sugsn_up($sdata)
  {
      $this-&gt;db-&gt;insert('suggestion _master',$sdata);
  }
  </code></pre>
  
  <p>My suggestion _master table has 6 filds</p>
  
  <p>Field   Type      Collation
      sug_id    bigint(20)<br>
      emp_id    bigint(20)<br>
      sug_name  text<br>
      course_id bigint(20)<br>
      sub_id    bigint(20)<br>
      link      text</p>
  
  <p>and i am getting this error</p>
  
  <p>A Database Error Occurred</p>
  
  <p>Error Number: 1064</p>
  
  <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '_master (<code>sug_id</code>, <code>emp_id</code>, <code>sug_name</code>, <code>course_id</code>, <code>sub_id</code>, <code>link</code>) VALUES (' at line 1</p>
  
  <p>INSERT INTO <code>suggestion</code> _master (<code>sug_id</code>, <code>emp_id</code>, <code>sug_name</code>, <code>course_id</code>, <code>sub_id</code>, <code>link</code>) VALUES (NULL, '1', 'test', '1', '1', 'file_link[soflo shows error when posting the exact link]')</p>
  
  <p>Filename: C:\wamp\www\CMC\system\database\DB_driver.php</p>
  
  <p>Line Number: 330</p>
  
  <p>Can you find any thing wrong here?please help</p>
  
  <p>Thanks and regards
  Dibyendu    </p>