I am using this script, but for some reason, half the values do not insert into the database, the pictures uploads fine. it is like is is only doing half the INSERT Query.
<?php
$file_dir = "/www/htdocs/images/propertymanagement/buildings";
$file_url = "http://www.mysitecom/images/propertymanagement/buildings";
// print "path: $property_imagelocation<br>\n";
// print "name: $property_imagelocation_name<br>\n";
// print "size: $property_imagelocation_size bytes<br>\n";
// print "type: $property_imagelocation_type<p>\n\n";
if ( ( $property_imagelocation_type == "image/pjpeg") && $MAX_FILE_SIZE <= "51200" )
{
$db = "";
$link = mysql_connect("");
if ( !$link ) die( "Couldn't connect to MySQL".mysql_error() );
mysql_select_db( $db, $link ) or die( "Couldn't open $db: ".mysql_error() );
$sql = "INSERT INTO property VALUES ('','$property_name', '$property_address', '$property_city', '$property_state', '$property_zip', '$property_briefdescription', '$property_communityinfo', '$property_imagelocation_name', '$property_type', '$property_agent1', '$property_agent2', '$property_agent3', '$property_agent4', '$property_agent5', '$property_agent6')";
mysql_query( $sql, $link );
mysql_close( $link );
copy ( "$property_imagelocation", "../images/propertymanagement/buildings/$property_imagelocation_name" ) or die ("Couldn't copy");
}
else
{
if ( $MAX_FILE_SIZE > "32000" ){
print "File size beyond maximum size of 51,200 bytes - ($property_imagelocation_size bytes)";
exit;
}
elseif ( $property_imagelocation_type != "image/pjpeg" ){
print "Invalid file type $property_imagelocation_type. Please submit only pjepg images (with extensions .jpg / .jpeg)";
exit;
}
else
{
print "Failed - reason unknown.";
exit;
}
}
print "<meta http-equiv=\"refresh\" content=\"1; URL=viewproperty.php\">";
?>
Thanks in advance