Hi guys i have a form to modify an existing article, which includes and upload form to upload images. If the user updates the article without updating the image the image path stored in the mysql database is made null
heres how my script works
upload image via form saves to webserver while sending the path to the image in mysql
Anyways
//ensure image is not deleted if modified with null
if(!isset($_FILES['picture1']['name']))
{
$query = "select picture1path from cardata where id=$id";
$result = mysql_query($query);
$row = mysql_fetch_object($result);
$picture1_name=$row->picture1path;
}
else
{
//check picture1 MIME type
if (!in_array($picture1_type, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png')))
and it continues with image formatting etc...
This still does not fix my problem, i can upload an existing image, but if i leave the upload form blank so does the value picture1_name
Any ideas?
Thanks