I have a script that works fine on my test box but now that I've uploaded it to the production server, I'm having problems.
if($_FILES['file1']['size'] > 0){
$target_path = "../propimages/areas/";
$tmp_name = $_FILES['file1']['tmp_name'];
$name = $_FILES['file1']['name'];
if(!move_uploaded_file($tmp_name, "$target_path$name")){
if(!is_writable($target_path)){
echo "path not writable<br />";
}
echo "Could not upload the file<br />";
echo "$target_path$name<br />";
echo $target_path."<br />";
exit();
}else{
$areaPhoto = "$target_path$name";
exec("/usr/bin/mogrify -resize 210x158! ".$areaPhoto."");
$query = "INSERT INTO `pictures` SET
areaID = '".$id."',
path = '".$areaPhoto."',
caption = '".$caption1."'";
$result = mysql_query($query);
if(!$result){
echo mysql_error();
exit;
}
}
}
The file gets uploaded, I can go find it without a problem. But none of the information is inserted into the database. I've verified the table exists and obviously it's running into some error that's not getting trapped by:
if(!$result){
echo mysql_error();
exit;
}
It's driving me crazy! HELP! Thanks in advance to all!