insert list of array files php

I am trying to insert the image name of my uploaded images. I can print the name of the image and insert the images into my mysql. The problem is I can’t insert each image on the same line of the database. I am trying to insert the name of image 1 “into itm_pic_name” & “itm_pic_name2”. I have created a list of image names using the php list function. How do I convert this list into variables that I can insert. Here is a portion of my code. Hope this helps.

[php]var_dump($files);
print_r(array_slice(array($files),0));

//prints a list of the files
list($file1)=$files;

//this is where I need to define each $file1 with a variable so I can insert it later

$mysqli = new mysqli(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
$this->execSQL(“INSERT INTO itm_pic_detail(itm_pic_name,itm_pic_name2,itm_pic_type, itm_pic_size) VALUES (?,?,?,?)”,
array(‘ssss’,$file1,$file1,$type, $size),true);
[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service