-1
I skipped a site to a server, making all the necessary settings, I have gallery control that has an upload file that sends the data to the folder and the information to the bank, nothing out of the ordinary, but the problem is that the way I did, just sending the data to the folder and not to the bank... What I’m doing wrong?
Follow the code block I’ve tried so far:
<?php
if(!empty($_FILES)){
require 'conn/conn1.php';
$targetDir = "uploads/";
$fileName = $_FILES['file']['name'];
$targetFilePath = $targetDir.$fileName;
if(move_uploaded_file($_FILES['file']['tmp_name'], $targetFilePath)){
$insert = $conn1->query("INSERT INTO files (file_name, uploaded_on) VALUES ('".$fileName."', NOW())");
}
}
?>
What remains is to treat the error that is possibly happening on INSERT, and for that there are N forms. If your connection is in PDO, you can already extract some information by placing this small stretch after the INSERT:
var_dump($conn1->errorInfo());
.– Diego Martins
thank you, I discovered the problem, it was in the table structure in the bank, but thank you
– Daniel