FILE INPUT INSERT INTO BD WITH MOVE_TO_FILE





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















This is more of a question to gain a more clear understanding. If I insert from a form like:



 <form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>


into the DB for a link and it's successful:



 $file = "INSERT INTO ('foo') VALUES ('FOO', NOW())";


just an example:



yet in the php script:



  $_FILE['fileToUpload']['name'];
$_FILE['fileToUpload']['tmp_name'];


since the tmp_name folder only holds upload files in an array, which than I would have to use either a foreach or for loop search the loop of files, this than makes the INSERT INTO db difficult.



Question is how can I separate the search results from the array and than insert each one into the database?



HERE"S THE CODE:



     <?php
$con = mysqli_connect("localhost","root","","acc1");
if(mysqli_connect_errno()){
echo 'Failed to connect to MySQL:' . mysqli_connect_error();
}else{
echo 'Connected!';
}
if(isset($_POST['submit']) && !empty($_FILES['fileBC']['name'] && !empty($_FILES['fileB']['name'] && !empty($_FILES['fileBR']['name']) ))){

$file = "image/";
$name = $_FILES['fileBC']['name'];
$data = $_FILES['fileBC']['tmp_name'];
$fileV = "video/";
$nameV = $_FILES['fileBR']['name'];
$dataV = $_FILES['fileBR']['tmp_name'];
$fileB = "book/";
$nameB = $_FILES['fileB']['name'];
$dataB = $_FILES['fileB']['tmp_name'];
if(move_uploaded_file($data,$file.$name)){
$ins_name = $con->query("INSERT INTO fileimages (fileBC, fileBR, fileB) VALUES ('$name','$nameB', '$nameV')");
}if($ins_name){
echo 'success!';
}else{
echo 'error';
}
}

?>
<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/fontawesome.css">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
</head>
<script>
function mymodal(){
$('#myModal').modal('show');

}

</script>
<body>
<form method="post" action="index.php" enctype="multipart/form-data">
<div class="form-group">
<label class="text-primary">Book Cover:</label>
<input class="form-control" type="file" name="fileBC" accept="image/*" >
</div>
<div class="form-group">
<label class="text-primary">Book:</label>
<input class="form-control" type="file" name="fileB" accept=".epub, .mobi, .pdf, .prc, .azw, .bbeb" >
</div>
<div class="form-group">
<label class="text-primary">Book Reading:</label>
<input class="form-control" type="file" name="fileBR" accept="video/*" >
</div>
<button name="submit">upload</button>
</form>
<p></p>
<ol>

</ol>
</body>
</html>









share|improve this question

























  • Why do you want to do this in such way?

    – Amit Rajput
    Jan 3 at 6:30











  • because this creates a link or url in the database in one form input if I can move the other contents to the other folders

    – Damian Mitchell
    Jan 3 at 6:33











  • allowing me to just place certain info in the link or url

    – Damian Mitchell
    Jan 3 at 6:34











  • You have two id="fileToUpload" in your code, which is invalid, id needs to be unique. The php manual itself has documentation on uploading multiple files

    – kerbholz
    Jan 3 at 7:26


















0















This is more of a question to gain a more clear understanding. If I insert from a form like:



 <form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>


into the DB for a link and it's successful:



 $file = "INSERT INTO ('foo') VALUES ('FOO', NOW())";


just an example:



yet in the php script:



  $_FILE['fileToUpload']['name'];
$_FILE['fileToUpload']['tmp_name'];


since the tmp_name folder only holds upload files in an array, which than I would have to use either a foreach or for loop search the loop of files, this than makes the INSERT INTO db difficult.



Question is how can I separate the search results from the array and than insert each one into the database?



HERE"S THE CODE:



     <?php
$con = mysqli_connect("localhost","root","","acc1");
if(mysqli_connect_errno()){
echo 'Failed to connect to MySQL:' . mysqli_connect_error();
}else{
echo 'Connected!';
}
if(isset($_POST['submit']) && !empty($_FILES['fileBC']['name'] && !empty($_FILES['fileB']['name'] && !empty($_FILES['fileBR']['name']) ))){

$file = "image/";
$name = $_FILES['fileBC']['name'];
$data = $_FILES['fileBC']['tmp_name'];
$fileV = "video/";
$nameV = $_FILES['fileBR']['name'];
$dataV = $_FILES['fileBR']['tmp_name'];
$fileB = "book/";
$nameB = $_FILES['fileB']['name'];
$dataB = $_FILES['fileB']['tmp_name'];
if(move_uploaded_file($data,$file.$name)){
$ins_name = $con->query("INSERT INTO fileimages (fileBC, fileBR, fileB) VALUES ('$name','$nameB', '$nameV')");
}if($ins_name){
echo 'success!';
}else{
echo 'error';
}
}

?>
<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/fontawesome.css">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
</head>
<script>
function mymodal(){
$('#myModal').modal('show');

}

</script>
<body>
<form method="post" action="index.php" enctype="multipart/form-data">
<div class="form-group">
<label class="text-primary">Book Cover:</label>
<input class="form-control" type="file" name="fileBC" accept="image/*" >
</div>
<div class="form-group">
<label class="text-primary">Book:</label>
<input class="form-control" type="file" name="fileB" accept=".epub, .mobi, .pdf, .prc, .azw, .bbeb" >
</div>
<div class="form-group">
<label class="text-primary">Book Reading:</label>
<input class="form-control" type="file" name="fileBR" accept="video/*" >
</div>
<button name="submit">upload</button>
</form>
<p></p>
<ol>

</ol>
</body>
</html>









share|improve this question

























  • Why do you want to do this in such way?

    – Amit Rajput
    Jan 3 at 6:30











  • because this creates a link or url in the database in one form input if I can move the other contents to the other folders

    – Damian Mitchell
    Jan 3 at 6:33











  • allowing me to just place certain info in the link or url

    – Damian Mitchell
    Jan 3 at 6:34











  • You have two id="fileToUpload" in your code, which is invalid, id needs to be unique. The php manual itself has documentation on uploading multiple files

    – kerbholz
    Jan 3 at 7:26














0












0








0








This is more of a question to gain a more clear understanding. If I insert from a form like:



 <form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>


into the DB for a link and it's successful:



 $file = "INSERT INTO ('foo') VALUES ('FOO', NOW())";


just an example:



yet in the php script:



  $_FILE['fileToUpload']['name'];
$_FILE['fileToUpload']['tmp_name'];


since the tmp_name folder only holds upload files in an array, which than I would have to use either a foreach or for loop search the loop of files, this than makes the INSERT INTO db difficult.



Question is how can I separate the search results from the array and than insert each one into the database?



HERE"S THE CODE:



     <?php
$con = mysqli_connect("localhost","root","","acc1");
if(mysqli_connect_errno()){
echo 'Failed to connect to MySQL:' . mysqli_connect_error();
}else{
echo 'Connected!';
}
if(isset($_POST['submit']) && !empty($_FILES['fileBC']['name'] && !empty($_FILES['fileB']['name'] && !empty($_FILES['fileBR']['name']) ))){

$file = "image/";
$name = $_FILES['fileBC']['name'];
$data = $_FILES['fileBC']['tmp_name'];
$fileV = "video/";
$nameV = $_FILES['fileBR']['name'];
$dataV = $_FILES['fileBR']['tmp_name'];
$fileB = "book/";
$nameB = $_FILES['fileB']['name'];
$dataB = $_FILES['fileB']['tmp_name'];
if(move_uploaded_file($data,$file.$name)){
$ins_name = $con->query("INSERT INTO fileimages (fileBC, fileBR, fileB) VALUES ('$name','$nameB', '$nameV')");
}if($ins_name){
echo 'success!';
}else{
echo 'error';
}
}

?>
<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/fontawesome.css">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
</head>
<script>
function mymodal(){
$('#myModal').modal('show');

}

</script>
<body>
<form method="post" action="index.php" enctype="multipart/form-data">
<div class="form-group">
<label class="text-primary">Book Cover:</label>
<input class="form-control" type="file" name="fileBC" accept="image/*" >
</div>
<div class="form-group">
<label class="text-primary">Book:</label>
<input class="form-control" type="file" name="fileB" accept=".epub, .mobi, .pdf, .prc, .azw, .bbeb" >
</div>
<div class="form-group">
<label class="text-primary">Book Reading:</label>
<input class="form-control" type="file" name="fileBR" accept="video/*" >
</div>
<button name="submit">upload</button>
</form>
<p></p>
<ol>

</ol>
</body>
</html>









share|improve this question
















This is more of a question to gain a more clear understanding. If I insert from a form like:



 <form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>


into the DB for a link and it's successful:



 $file = "INSERT INTO ('foo') VALUES ('FOO', NOW())";


just an example:



yet in the php script:



  $_FILE['fileToUpload']['name'];
$_FILE['fileToUpload']['tmp_name'];


since the tmp_name folder only holds upload files in an array, which than I would have to use either a foreach or for loop search the loop of files, this than makes the INSERT INTO db difficult.



Question is how can I separate the search results from the array and than insert each one into the database?



HERE"S THE CODE:



     <?php
$con = mysqli_connect("localhost","root","","acc1");
if(mysqli_connect_errno()){
echo 'Failed to connect to MySQL:' . mysqli_connect_error();
}else{
echo 'Connected!';
}
if(isset($_POST['submit']) && !empty($_FILES['fileBC']['name'] && !empty($_FILES['fileB']['name'] && !empty($_FILES['fileBR']['name']) ))){

$file = "image/";
$name = $_FILES['fileBC']['name'];
$data = $_FILES['fileBC']['tmp_name'];
$fileV = "video/";
$nameV = $_FILES['fileBR']['name'];
$dataV = $_FILES['fileBR']['tmp_name'];
$fileB = "book/";
$nameB = $_FILES['fileB']['name'];
$dataB = $_FILES['fileB']['tmp_name'];
if(move_uploaded_file($data,$file.$name)){
$ins_name = $con->query("INSERT INTO fileimages (fileBC, fileBR, fileB) VALUES ('$name','$nameB', '$nameV')");
}if($ins_name){
echo 'success!';
}else{
echo 'error';
}
}

?>
<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/fontawesome.css">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
</head>
<script>
function mymodal(){
$('#myModal').modal('show');

}

</script>
<body>
<form method="post" action="index.php" enctype="multipart/form-data">
<div class="form-group">
<label class="text-primary">Book Cover:</label>
<input class="form-control" type="file" name="fileBC" accept="image/*" >
</div>
<div class="form-group">
<label class="text-primary">Book:</label>
<input class="form-control" type="file" name="fileB" accept=".epub, .mobi, .pdf, .prc, .azw, .bbeb" >
</div>
<div class="form-group">
<label class="text-primary">Book Reading:</label>
<input class="form-control" type="file" name="fileBR" accept="video/*" >
</div>
<button name="submit">upload</button>
</form>
<p></p>
<ol>

</ol>
</body>
</html>






php html






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 7:51







Damian Mitchell

















asked Jan 3 at 6:22









Damian MitchellDamian Mitchell

177




177













  • Why do you want to do this in such way?

    – Amit Rajput
    Jan 3 at 6:30











  • because this creates a link or url in the database in one form input if I can move the other contents to the other folders

    – Damian Mitchell
    Jan 3 at 6:33











  • allowing me to just place certain info in the link or url

    – Damian Mitchell
    Jan 3 at 6:34











  • You have two id="fileToUpload" in your code, which is invalid, id needs to be unique. The php manual itself has documentation on uploading multiple files

    – kerbholz
    Jan 3 at 7:26



















  • Why do you want to do this in such way?

    – Amit Rajput
    Jan 3 at 6:30











  • because this creates a link or url in the database in one form input if I can move the other contents to the other folders

    – Damian Mitchell
    Jan 3 at 6:33











  • allowing me to just place certain info in the link or url

    – Damian Mitchell
    Jan 3 at 6:34











  • You have two id="fileToUpload" in your code, which is invalid, id needs to be unique. The php manual itself has documentation on uploading multiple files

    – kerbholz
    Jan 3 at 7:26

















Why do you want to do this in such way?

– Amit Rajput
Jan 3 at 6:30





Why do you want to do this in such way?

– Amit Rajput
Jan 3 at 6:30













because this creates a link or url in the database in one form input if I can move the other contents to the other folders

– Damian Mitchell
Jan 3 at 6:33





because this creates a link or url in the database in one form input if I can move the other contents to the other folders

– Damian Mitchell
Jan 3 at 6:33













allowing me to just place certain info in the link or url

– Damian Mitchell
Jan 3 at 6:34





allowing me to just place certain info in the link or url

– Damian Mitchell
Jan 3 at 6:34













You have two id="fileToUpload" in your code, which is invalid, id needs to be unique. The php manual itself has documentation on uploading multiple files

– kerbholz
Jan 3 at 7:26





You have two id="fileToUpload" in your code, which is invalid, id needs to be unique. The php manual itself has documentation on uploading multiple files

– kerbholz
Jan 3 at 7:26












1 Answer
1






active

oldest

votes


















0














This is an example you can adept it as per your need.



<form action="file_reciever.php" enctype="multipart/form-data" method="post">
<input type="file" name="files" multiple/>
<input type="submit" name="submission" value="Upload"/>
</form>


PHP code is like



<?php
if (isset($_POST['submission'] && $_POST['submission'] != null) {
for ($i = 0; $i < count($_FILES['files']['name']); $i++) {
//Get the temp file path
$tmpFilePath = $_FILES['files']['tmp_name'][$i];

//Make sure we have a filepath
if ($tmpFilePath != "") {
//Setup our new file path
$newFilePath = "./uploadFiles/" . $_FILES['files']['name'][$i];

//Upload the file into the temp dir
if (move_uploaded_file($tmpFilePath, $newFilePath)) {

//Your insert statement goes here

}
}
}
}
?>





share|improve this answer


























  • I'm still stuck with the tmp file as being the folder and turning this into an array which means that my results will output $_FILES['files']['name'][0], $_FILES['files']['name'][1], $_FILES['files']['name'][2],...etc

    – Damian Mitchell
    Jan 3 at 6:40











  • which than makes the insert into three variables that have to be placed into the database yet that doesn't match the html

    – Damian Mitchell
    Jan 3 at 6:40











  • What you have wrote in insert statement?

    – Rajesh
    Jan 3 at 6:44











  • the problem I ran across is that when I use INSERT I no longer have the name or values from the html form. Now I have had a two file success on the INSERT yet not the move_to_file. when I have success on one there's no success on the other

    – Damian Mitchell
    Jan 3 at 6:46











  • Could you please add your code for better understanding?

    – Rajesh
    Jan 3 at 6:58












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54017261%2ffile-input-insert-into-bd-with-move-to-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This is an example you can adept it as per your need.



<form action="file_reciever.php" enctype="multipart/form-data" method="post">
<input type="file" name="files" multiple/>
<input type="submit" name="submission" value="Upload"/>
</form>


PHP code is like



<?php
if (isset($_POST['submission'] && $_POST['submission'] != null) {
for ($i = 0; $i < count($_FILES['files']['name']); $i++) {
//Get the temp file path
$tmpFilePath = $_FILES['files']['tmp_name'][$i];

//Make sure we have a filepath
if ($tmpFilePath != "") {
//Setup our new file path
$newFilePath = "./uploadFiles/" . $_FILES['files']['name'][$i];

//Upload the file into the temp dir
if (move_uploaded_file($tmpFilePath, $newFilePath)) {

//Your insert statement goes here

}
}
}
}
?>





share|improve this answer


























  • I'm still stuck with the tmp file as being the folder and turning this into an array which means that my results will output $_FILES['files']['name'][0], $_FILES['files']['name'][1], $_FILES['files']['name'][2],...etc

    – Damian Mitchell
    Jan 3 at 6:40











  • which than makes the insert into three variables that have to be placed into the database yet that doesn't match the html

    – Damian Mitchell
    Jan 3 at 6:40











  • What you have wrote in insert statement?

    – Rajesh
    Jan 3 at 6:44











  • the problem I ran across is that when I use INSERT I no longer have the name or values from the html form. Now I have had a two file success on the INSERT yet not the move_to_file. when I have success on one there's no success on the other

    – Damian Mitchell
    Jan 3 at 6:46











  • Could you please add your code for better understanding?

    – Rajesh
    Jan 3 at 6:58
















0














This is an example you can adept it as per your need.



<form action="file_reciever.php" enctype="multipart/form-data" method="post">
<input type="file" name="files" multiple/>
<input type="submit" name="submission" value="Upload"/>
</form>


PHP code is like



<?php
if (isset($_POST['submission'] && $_POST['submission'] != null) {
for ($i = 0; $i < count($_FILES['files']['name']); $i++) {
//Get the temp file path
$tmpFilePath = $_FILES['files']['tmp_name'][$i];

//Make sure we have a filepath
if ($tmpFilePath != "") {
//Setup our new file path
$newFilePath = "./uploadFiles/" . $_FILES['files']['name'][$i];

//Upload the file into the temp dir
if (move_uploaded_file($tmpFilePath, $newFilePath)) {

//Your insert statement goes here

}
}
}
}
?>





share|improve this answer


























  • I'm still stuck with the tmp file as being the folder and turning this into an array which means that my results will output $_FILES['files']['name'][0], $_FILES['files']['name'][1], $_FILES['files']['name'][2],...etc

    – Damian Mitchell
    Jan 3 at 6:40











  • which than makes the insert into three variables that have to be placed into the database yet that doesn't match the html

    – Damian Mitchell
    Jan 3 at 6:40











  • What you have wrote in insert statement?

    – Rajesh
    Jan 3 at 6:44











  • the problem I ran across is that when I use INSERT I no longer have the name or values from the html form. Now I have had a two file success on the INSERT yet not the move_to_file. when I have success on one there's no success on the other

    – Damian Mitchell
    Jan 3 at 6:46











  • Could you please add your code for better understanding?

    – Rajesh
    Jan 3 at 6:58














0












0








0







This is an example you can adept it as per your need.



<form action="file_reciever.php" enctype="multipart/form-data" method="post">
<input type="file" name="files" multiple/>
<input type="submit" name="submission" value="Upload"/>
</form>


PHP code is like



<?php
if (isset($_POST['submission'] && $_POST['submission'] != null) {
for ($i = 0; $i < count($_FILES['files']['name']); $i++) {
//Get the temp file path
$tmpFilePath = $_FILES['files']['tmp_name'][$i];

//Make sure we have a filepath
if ($tmpFilePath != "") {
//Setup our new file path
$newFilePath = "./uploadFiles/" . $_FILES['files']['name'][$i];

//Upload the file into the temp dir
if (move_uploaded_file($tmpFilePath, $newFilePath)) {

//Your insert statement goes here

}
}
}
}
?>





share|improve this answer















This is an example you can adept it as per your need.



<form action="file_reciever.php" enctype="multipart/form-data" method="post">
<input type="file" name="files" multiple/>
<input type="submit" name="submission" value="Upload"/>
</form>


PHP code is like



<?php
if (isset($_POST['submission'] && $_POST['submission'] != null) {
for ($i = 0; $i < count($_FILES['files']['name']); $i++) {
//Get the temp file path
$tmpFilePath = $_FILES['files']['tmp_name'][$i];

//Make sure we have a filepath
if ($tmpFilePath != "") {
//Setup our new file path
$newFilePath = "./uploadFiles/" . $_FILES['files']['name'][$i];

//Upload the file into the temp dir
if (move_uploaded_file($tmpFilePath, $newFilePath)) {

//Your insert statement goes here

}
}
}
}
?>






share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 3 at 12:29









Tanmay Patel

919920




919920










answered Jan 3 at 6:34









RajeshRajesh

1258




1258













  • I'm still stuck with the tmp file as being the folder and turning this into an array which means that my results will output $_FILES['files']['name'][0], $_FILES['files']['name'][1], $_FILES['files']['name'][2],...etc

    – Damian Mitchell
    Jan 3 at 6:40











  • which than makes the insert into three variables that have to be placed into the database yet that doesn't match the html

    – Damian Mitchell
    Jan 3 at 6:40











  • What you have wrote in insert statement?

    – Rajesh
    Jan 3 at 6:44











  • the problem I ran across is that when I use INSERT I no longer have the name or values from the html form. Now I have had a two file success on the INSERT yet not the move_to_file. when I have success on one there's no success on the other

    – Damian Mitchell
    Jan 3 at 6:46











  • Could you please add your code for better understanding?

    – Rajesh
    Jan 3 at 6:58



















  • I'm still stuck with the tmp file as being the folder and turning this into an array which means that my results will output $_FILES['files']['name'][0], $_FILES['files']['name'][1], $_FILES['files']['name'][2],...etc

    – Damian Mitchell
    Jan 3 at 6:40











  • which than makes the insert into three variables that have to be placed into the database yet that doesn't match the html

    – Damian Mitchell
    Jan 3 at 6:40











  • What you have wrote in insert statement?

    – Rajesh
    Jan 3 at 6:44











  • the problem I ran across is that when I use INSERT I no longer have the name or values from the html form. Now I have had a two file success on the INSERT yet not the move_to_file. when I have success on one there's no success on the other

    – Damian Mitchell
    Jan 3 at 6:46











  • Could you please add your code for better understanding?

    – Rajesh
    Jan 3 at 6:58

















I'm still stuck with the tmp file as being the folder and turning this into an array which means that my results will output $_FILES['files']['name'][0], $_FILES['files']['name'][1], $_FILES['files']['name'][2],...etc

– Damian Mitchell
Jan 3 at 6:40





I'm still stuck with the tmp file as being the folder and turning this into an array which means that my results will output $_FILES['files']['name'][0], $_FILES['files']['name'][1], $_FILES['files']['name'][2],...etc

– Damian Mitchell
Jan 3 at 6:40













which than makes the insert into three variables that have to be placed into the database yet that doesn't match the html

– Damian Mitchell
Jan 3 at 6:40





which than makes the insert into three variables that have to be placed into the database yet that doesn't match the html

– Damian Mitchell
Jan 3 at 6:40













What you have wrote in insert statement?

– Rajesh
Jan 3 at 6:44





What you have wrote in insert statement?

– Rajesh
Jan 3 at 6:44













the problem I ran across is that when I use INSERT I no longer have the name or values from the html form. Now I have had a two file success on the INSERT yet not the move_to_file. when I have success on one there's no success on the other

– Damian Mitchell
Jan 3 at 6:46





the problem I ran across is that when I use INSERT I no longer have the name or values from the html form. Now I have had a two file success on the INSERT yet not the move_to_file. when I have success on one there's no success on the other

– Damian Mitchell
Jan 3 at 6:46













Could you please add your code for better understanding?

– Rajesh
Jan 3 at 6:58





Could you please add your code for better understanding?

– Rajesh
Jan 3 at 6:58




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54017261%2ffile-input-insert-into-bd-with-move-to-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

Npm cannot find a required file even through it is in the searched directory