我有一个代码可以让一个人通过表单上传多张图片。
问题是,图像可以很好地上传到服务器,但不确定如何将图像发送到数据库。
PHP:
else{ // No error found! Move uploaded files
if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $targetscreenshots.$name))
$count++; // Number of successfully uploaded file
}
我把下面的代码放在哪里?
{
mysql_query("INSERT into Colleges (`files`) VALUES ('$files')"); // inserting data if file is moved
echo "Your screenshots have been uploaded successfully!"
}