Create an array with what you need to load into your db ... and then paste it into db, put something like this in else:
//create array to load to database $insert_data = array( 'name' => $image_data['file_name'], 'path' => $image_data['full_path'], 'thumb_path'=> $image_data['file_path'] . 'thumbs/'. $image_data['file_name'], 'tag' => $tag ); $this->db->insert('photos', $insert_data);//load array to database
Important: array indexes get the same name as the columns of your table!
also try and use your model, this will make your code a little easier to maintain, read, etc. good luck!
source share