I am working on a picture submit with a form. It is copying the file up with php and it goes in directory but its not entering the information in the database.
Anyone help me ..
if(isset( $Submit ))
{
if ($_FILES['imagefile']['type'] == "image/jpeg"){
copy ($_FILES['imagefile']['tmp_name'], "uploads/".$_FILES['imagefile']['name'])
or die ("Could not copy");
$date = date("Y-m-d");
$labelname = $_FILES['imagefile']['name'];
$db = @mysql_connect("$MySQL_Ip","$MySQL_Username","$MySQL_Password");
if (!$db) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("$MySQL_Database" ,$db);
$sql = "INSERT INTO labels (labelname,title,designer,type,date) VALUES ('$labelname','$subtitle','$subdesigner','$subtype','$date')";
$result = mysql_query($sql);
if(!$result) {
die('Could not connect: ' . mysql_error());
}
echo "";
echo "Name: ".$_FILES['imagefile']['name']."";
echo "Size: ".$_FILES['imagefile']['size']."";
echo "Type: ".$_FILES['imagefile']['type']."";
echo "Copy Done....";
}
else {
echo "";
echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")";
}
}