This is a file that receives uploaded images from another page. The images are received and saved on the server (that part is working) the query is not. I manually typed the query into phpMyAdmin with dummy values for the file name and it works. I put that dummy query into this code and it doesn't work. I can't figure out what I'm doing wrong.
<?php
$ds = DIRECTORY_SEPARATOR;
$storeFolder = 'img';
if (!empty($_FILES)) {
$tempFile = $_FILES['file']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT']. $ds. $storeFolder . $ds;
$targetFile = $targetPath. $_FILES['file']['name'];
move_uploaded_file($tempFile,$targetFile);
mysql_query("INSERT INTO `photos` (photo_id, file_name) VALUES ('', '".$_FILES['file']['name']."');");
}
?>