There is the usual form of adding photos to the server:
<form method="post" multipart="" enctype="multipart/form-data"> <input type="file" name="img[]" multiple> <input type="submit"> </form> PHP form processing:
$img = $_FILES['img']; if(!empty($img)) { $img_desc = reArrayFiles($img); print_r($img_desc); foreach($img_desc as $val) { $newname = date('YmdHis',time()).mt_rand().'.jpg'; move_uploaded_file($val['tmp_name'],'./filedat/'.$newname); } } function reArrayFiles($file) { $file_ary = array(); $file_count = count($file['name']); $file_key = array_keys($file); for($i=0;$i<$file_count;$i++) { foreach($file_key as $val) { $file_ary[$i][$val] = $file[$val][$i]; } } return $file_ary; } This code works the way I need it. Uploads multiple images to the server. But I also need to do this so that the links to these files are saved to the database, so that later they can be displayed on the advertisement page. Please show me an example of how to save the loaded images in Mysql into one cell in this way:
img1, img2, img3, etc.