Welcome Guest, Not a member yet? Register   Sign In
Newbie: if using a model to update a database, how do i add upload data
#1

[eluser]loopymonkey[/eluser]
I'm confused how this should be written using a model to add to my database:

Code:
function add_toMyDatabase()
  {
    $YourName = $this->input->post('YourName');
    $upload_data['file_name'] = $this->input->post('userfile');
    $this->db->query("INSERT INTO toMyDatabase (id, YourName, userfile) VALUES(NULL, '$YourName', '$userfile')");
  }

From a form i am uploading a person's name and the name of the file that i received. I know my $upload_data contains the information i need since i'm using the upload helper, I'm just not certain how i can get JUST the file_name and put it into my database's field called userfile.

Any leads or help appreciated!


Messages In This Thread
Newbie: if using a model to update a database, how do i add upload data - by El Forum - 12-13-2007, 10:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB