Welcome Guest, Not a member yet? Register   Sign In
Trying to put info from files into database
#3

ok atm I am not too bothered about the width and height then.  I have tried the following but I am getting an "Invalid argument supplied for foreach()"


PHP Code:
$this->db->truncate('gallery_images');

 
   $this->load->helper('directory');
 
   $this->load->helper('file');
 
   
    $files 
directory_map(base_url().'public/images/gallery/');
 
   
    foreach
($files as $file) {
 
       
        $get_info 
get_file_info($file);
 
       
        $data 
= array( 
 
           'category' => 'uncategorised',
 
           'image_name' => $get_info['name'],
 
           'alt' => $get_info['name'],
 
           'full_path' => $get_info['server_path'],
 
           'image_width' => '800',
 
           'image_height' => '600'
 
       );
 
       $this->add_content($data'gallery_images');

 
   }
 
   $this->session->set_flashdata('success_message''Gallery Reloaded');
 
   redirect('admin/gallery/gallery_images'); 
Reply


Messages In This Thread
RE: Trying to put info from files into database - by doomie22 - 09-29-2016, 02:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB