我一次上传 5 个文件。它上传成功,但是当我想更新一些特定文件(如文件 1 和文件 2)时,其他文件不应更改,它必须保持原样..但在我的情况下它变为空白..这是我的代码
if(isset($_REQUEST['update']))
{
$img1 = $_FILES['file_img1']['name'];
$fileElementName = 'file_img1';
$path = 'upload/';
$location = $path . $_FILES['file_img1']['name'];
move_uploaded_file($_FILES['file_img1']['tmp_name'], $location);
$img2 = $_FILES['file_img2']['name'];
$fileElementName = 'file_img2';
$path = 'upload/';
$location = $path . $_FILES['file_img2']['name'];
move_uploaded_file($_FILES['file_img2']['tmp_name'], $location);
$img3 = $_FILES['file_img3']['name'];
$fileElementName = 'file_img3';
$path = 'upload/';
$location = $path . $_FILES['file_img3']['name'];
move_uploaded_file($_FILES['file_img3']['tmp_name'], $location);
$img4 = $_FILES['file_img4']['name'];
$fileElementName = 'file_img4';
$path = 'upload/';
$location = $path . $_FILES['file_img4']['name'];
move_uploaded_file($_FILES['file_img4']['tmp_name'], $location);
$img5 = $_FILES['file_img5']['name'];
$fileElementName = 'file_img5';
$path = 'upload/';
$location = $path . $_FILES['file_img5']['name'];
move_uploaded_file($_FILES['file_img5']['tmp_name'], $location);
$sel="update tbl_job_schedule set
file1='$img1',
file2='$img2',
file3='$img3',
file4='$img4',
file5='$img5',
status='schwork',
user_cmntdate=now(),
cmnt='".$_REQUEST['addcmnt']."' where clientname='".$rw['clientname']."' and username='".$_SESSION['user']."' and jobdate='".$_SESSION['strmonth']."-".$_REQUEST['dt']."-".$_SESSION['yy']."'";
mysql_query($sel) or die($sel);
}