application/models/folder_model.php
//function to add the folder in the database
function to add the folder in the database
function to add the folder in the database
public function add_folder($user_id, $foldername)
	{
		$this->db->where('folder_name', $foldername);
		$query = $this->db->get("folders");
		if($query->num_rows() <= 0)
		{
			$data = array(
				'user_id'  	=> $this->session->userdata('user_id'),
				'folder_name' => $foldername
				);
			$this->db->insert('folders', $data);
		}
	}
public function add_folder ( $ user_id , $ foldername ) { $ this -> db -> where ( 'folder_name' , $ foldername ) ; $ query = $ this -> db -> get ( " folders " ) ; if ( $ query -> num_rows ( ) <= 0 ) { $ data = array ( 'user_id' => $ this -> session -> userdata ( 'user_id' ) , 'folder_name' => $ foldername ) ; $ this -> db -> insert ( 'folders' , $ data ) ; } }
function to add the folder in the database
function to add the folder in the database
//check if a folder with this name is already in the database //if the folder name has no duplicates we insert it's informations in the DB