$route_photo = $_FILES['image']['name'];
// if no new image and no existing image put NULL in the DB if(empty($_FILES['image']['name']) && ($_POST['oldimage']) == '') { $route_photo = 'NULL'; echo ("No image supplied.");
// if new image put the new image name in the DB
} elseif ($_POST['route_photo'] || $_FILES['image']['name']) {
$route_photo = $_POST['route_photo'];
echo ("The image has been replaced with $route_photo.");
// If no new image update, use the old image } elseif ($_POST['route_photo'] = $_POST['oldimage']) { $route_photo = $_POST['oldimage']; echo("No new image supplied"); }
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php