Welcome Guest, Not a member yet? Register   Sign In
file uploading
#1

[eluser]praveena[/eluser]
HI
I am trying to upload the file path in to the database and trying to move the file into root folder and this is my code

$config['upload_path']='./uploads';
$config['allowed_types']='.xls|xlsx';
$this->load->library('upload',$config);
$this->db->insert('data',$_POST);
$this->load->view('data');

and I was fillowing with this error pls help

A Database Error Occurred
You must use the "set" method to update an entry.

Thanks in Advance
#2

[eluser]LuckyFella73[/eluser]
The code you posted is not related to the error message you got.
Please post your model-code where your db update code runs.
#3

[eluser]praveena[/eluser]
$upload=array(
'filename'=>$this->input->post('filename'),
'filepath'=>$this->input->post('filepath'));
$insert= $this->db->insert('data',$upload);
return $insert;

This is my model code
#4

[eluser]LuckyFella73[/eluser]
That code looks ok. I think the error is not comming from there.
The error message is talking about "updating" while
the code you posted is about INSERT. Do you have other
sql statements in your controller? Can you provide more
code? Please use CODE-tags when posting code - it's far
more readable!
#5

[eluser]praveena[/eluser]
no more sql statments in the code this is just to upload the file path into databse and move the file into uploads folder i was unable to find the libraries will you help me




Theme © iAndrew 2016 - Forum software by © MyBB