Número de error: 1064 en codeigniter

I am getting this error when ever i am uploading a file and storing details in the database using codeigniter

aquí está mi controlador

    public function sugsn_up()
    if ( $this->session->userdata('login_state') == FALSE )
    $config['upload_path'] = './suggestion/';
    $config['allowed_types'] = 'pdf|doc|docx|txt';
    $config['max_size'] = '10000000';
    $this->load->library('upload', $config);
    if ( ! $this->upload->do_upload())
        $error = array('error' => $this->upload->display_errors());
        $this->load->view('faculty/up_sugsn', $error,$res);
        $data = array('upload_data' => $this->upload->data());
                 'course_id'=> $_POST['cid'],
                 'sub_id'=> $_POST['sid'],
        $this->load->view('faculty/upload_success', $data);

y este es mi modelo

    public function sugsn_up($sdata)
    $this->db->insert('suggestion _master',$sdata);

My suggestion _master table has 6 filds

Field Type Collation sug_id bigint(20)
emp_id bigint(20)
sug_name text
course_id bigint(20)
sub_id bigint(20)
link text

y recibo este error

Ocurrió Un Error en la Base de Datos

Número de error: 1064

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 (sug_id, emp_id, sug_name, course_id, sub_id, link) VALUES (' at line 1

Insertar en suggestion _master (sug_id, emp_id, sug_name, course_id, sub_id, link) VALUES (NULL, '1', 'test', '1', '1', 'file_link[soflo shows error when posting the exact link]')

Filename: C:\wamp\www\CMC\system\database\DB_driver.php

Número de línea: 330

Can you find any thing wrong here?please help

Thanks and regards Dibyendu

preguntado el 09 de septiembre de 13 a las 21:09

1 Respuestas

INSERT INTO `suggestion _master`..

Add backticks for table and column names if they contain empty spaces,but empty spaces in table names are not OK.

Respondido el 09 de Septiembre de 13 a las 21:09

thank you so much i didn't notice the empty space, its working now. - Dibyendu Singha Roy

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.