Posted inProgramming / Mysql / Mysqli / php

Multiple Image Upload using PHP into MYSQL database

Multiple Image Upload using PHP into MYSQL database

Today, We want to share with you Multiple Image Upload using PHP into MYSQL database.
In this post we will show you Multiple Image Upload using PHP into MYSQL database, hear for Multiple Image Upload using PHP into MYSQL database we will give you demo and example for implement.
In this post, we will learn about Multiple Image Upload using PHP into MYSQL database with an example.

i have This IMP POST explained about How to upload The multiple images or Files in the database(Like as a Mysql).

The Multiple all files or image can be uploaded using different name for HTML input.

enctype=”multipart/form-data”. 
 type=” file”

upload multiple images in php example

Use 
 

“Multiple Image Upload” using PHP into MYSQL database

File Structure

multiple_upload(Dir Name)
->upload(Dir Name)
->config.php
->index.php
->upload.php

DataBase Name : gallery_tbl

First of All Crate a Simple TABLE in Your DataBase.

Table Name : gallery

CREATE TABLE IF NOT EXISTS `gallery` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `image` varchar(250) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

File Name : Config.php

 

File Name : index.php


How to upload/store multiple images in mysql database in php

query("SELECT * FROM gallery"); if(isset($sql) && count($sql)) : // check condition foreach ($sql as $key => $row) : ?> //print all display all images

File Name : upload.php

query("INSERT INTO gallery(image) VALUES('$filename')");
	   if($fetch):
	   	 header('Location:index.php');
	   else :
         $error ='your Data not inserting';
	   endif;
	else :
		$error = 'your File (All images) moving unsuccessful';
	endif;
  else:
  	 $error = 'You have exceeded the File (some images or files)size limit!';
  endif;      
  }
else:
  $error = 'Your File not found!';
endif;			
?>

View Demo

We hope you get an idea about Multiple Image Upload using PHP into MYSQL database
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

We hope This Post can help you…….Good Luck!.

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

Your email address will not be published. Required fields are marked *

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype