The best I can do is link you to the relevant pages so that you can learn more. If you provide more information I might be able to help you more:
File upload:
http://codeigniter.com/user_guide/libraries/file_uploading.html
Database:
http://codeigniter.com/user_guide/database/index.html
I recommend using the Active Record part of the database library:
http://codeigniter.com/user_guide/database/active_record.html
As for how to stop form submission on page refresh, simply use redirect('controller/method'); after you have handled the form data. For example:
if(!is_bool($this->input->post('fieldvalue'))
{
$this->model->writeToDB($_POST);
redirect('controller/method');
}
so that every time data is submitted, it is added to the db and then the redirect will revisit the page, thus the browser won't remember what was in the post array and that will solve the problem.