Welcome Guest, Not a member yet? Register   Sign In
ho to image upload and save it in data base?
#2

[eluser]ludo31[/eluser]
Why you don't use db->insert in model

in my controller (it's not a full code )

Code:
$this->load->library('image_lib',$config);  
                               $this->image_lib->resize();
                               $image_name=$image_data['file_name'];
                     $data=array(
                        'nom_path'=>$image_name,
                        'identifiant_annonce'=>$identifannonce
                        
                            );
                            
                            
                          
                            
                            $this->annoncemodel->add_image($data);

and in model annoncemodel (image is my table for image

Code:
public function add_image($data)
       {
           $this->db->insert('image', $data );
          
       }


Messages In This Thread
ho to image upload and save it in data base? - by El Forum - 03-21-2012, 03:10 AM
ho to image upload and save it in data base? - by El Forum - 03-21-2012, 03:22 AM
ho to image upload and save it in data base? - by El Forum - 03-21-2012, 05:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB