Hello, I am trying to upload music files to a database for use on my website. However, the file doesn't seem to actually be going into the folder. I get the name of the file in phpmyadmin, but I don't see the file anywhere. Here's my script (I do have a directory in the database named music, so that doesn't seem to be the problem):
<?php
include "db_connect.php";
$tbl_name = "music";
$title = $_REQUEST['title'];
$type = $_REQUEST['type'];
$musicuploaddir = "music/";
$song = $musicuploaddir . basename($_FILES['song']['name']);
mysql_query("INSERT INTO $tbl_name (id, song, title, type) VALUES ('', '$song', '$title', '$type')");
$entrynumber = mysql_insert_id();
if ($song != "music/" && move_uploaded_file($_FILES['song']['tmp_name'], $musicuploaddir))
{
$songnewname = $musicuploaddir . $entrynumber . ".mp3";
rename($song, $songnewname);
mysql_query("UPDATE $tbl_name SET song='$songnewname' WHERE id=$entrynumber") or die( mysql_error() );
header("Location: music.php?song=$songnewname");
}
?>