application/models/upload_model.php
//function to add the file informations to the database
function to add the file informations to the database
function to add the file informations to the database
public function add_file($tmp_name, $name, $min_path)
	{
		$this->db->where('temp_name', $tmp_name);
		$query = $this->db->get("files");
		if($query->num_rows() <= 0)
		{
			$data = array(
				'user_id'  	=> $this->session->userdata('user_id'),
				'temp_name' => $tmp_name,
				'file_name' => $name,
				'url'       => $min_path
				);
			$this->db->insert('files', $data);
		}
	}
public function add_file ( $ tmp_name , $ name , $ min_path ) { $ this -> db -> where ( 'temp_name' , $ tmp_name ) ; $ query = $ this -> db -> get ( " files " ) ; if ( $ query -> num_rows ( ) <= 0 ) { $ data = array ( 'user_id' => $ this -> session -> userdata ( 'user_id' ) , 'temp_name' => $ tmp_name , 'file_name' => $ name , 'url' => $ min_path ) ; $ this -> db -> insert ( 'files' , $ data ) ; } }
function to add the file informations to the database
function to add the file informations to the database
//check if a file with this name is already in the database //if the file name has no duplicates we insert it's informations in the DB