multiple image upload in codeigniter

276
April 05, 2017, at 9:11 PM

Actually I want to upload multiple images to folder as well as to data base by comma separator. I have done like below but it is not adding to data base and even it is not uploading to folder also. Please some body help me.

Below is code,

$path = "images/additionalimages";
                     for($i=0; $i<count($_FILES['additional_images']['name']); $i++){
                     $extension =explode(',',$_FILES['additional_images']['name']);
                     // echo "<pre>";print_r($extension);
                      if(move_uploaded_file($path,$extension )) {
                      //insert query 
                         echo "uploaded successfully";
                          } else{
                        echo "Error in Upload";
                       }
                   }
                $event_name = ucwords(strtolower($this->input->post('event_name')));
                $event_image = $eventmain_image;
                $description = $this->input->post('event_description');
                $start_date = $this->input->post('start_date');
                $end_date = $this->input->post('end_date');
                $additional_images = $extension;
                $eventInfo = array('event_name'=>$event_name, 'event_image'=>$event_image, 'event_description'=>$description, 'start_date'=> $start_date,
                                    'start_date'=>$start_date,'end_date'=>$end_date,'additional_images'=> $additional_images,'status'=>0);
READ ALSO
Mysql External php api column issue - failed to execute()

Mysql External php api column issue - failed to execute()

I have created one API using php slim framework which has loginregister

265
Getting all weekend dates for year in php or javascript

Getting all weekend dates for year in php or javascript

How to get all sunday and saturday dates for year in php or javascript?

221
ftp_chdir(): Failed to change directory

ftp_chdir(): Failed to change directory

I am getting success from ftp_connect and ftp_login functions but I am not able to change directory with ftp_chdir or even upload a file on remote server with ftp_put functionsIt's giving me errors as

765
Can not Import csv file in CakePHP

Can not Import csv file in CakePHP

I have Province, City, School, Standard, and User table on databaseI want to insert user list to table user but also insert to province, city, school and standard table

286