multiple file uploads

+1 naqash baig · October 20, 2015
How we can upload multiple files using 1 query and then display it in a loop...
like if i wanted to display 4 images in a jquery slider how will i first upload it using CMS and then displaying it to the users in the slider properly cz right now am facing these peoblems that i cant upload them all at once and cant display the images properly in the slider.

Post a Reply


Oldest  Newest  Rating
0 Casper Hollemans · October 21, 2015
you'r code should look like somthing like this:

$stmt = mysqli_query$("INSERT INTO Table_Name (name, value) VALUES (:name, :value)");
$stmt->bindParam(':name', collumn_Name);
$stmt->bindParam(':value', value_Name);

If you're not sure how many pictures will be uploaded, so it can be 1 ether it can be 100 i'd suggest to store them in a array and loop trough it like this:

foreach(array as pictureName){
$stmt = mysqli_query$("INSERT INTO Table_Name (name, value) VALUES (:name, :value)");
$stmt->bindParam(':name', collumn_Name);
$stmt->bindParam(':value', $pictureName);

and after that to show all the photo's you just need to select all row's in your query and sore it in a array

hope it helps 

0 husain saify · November 15, 2015
Try this article on Multiple file upload 
  • 1



Server-side, HTML embedded scripting language used to create dynamic Web pages.