i am uploading some data to the db that contain title, news date and image, but when i want to update it i am facing problems.what i want to do basically if i update all the row except image then updation do not take place. what i want basically when i have to update lets suppose title only then it should update it but all other data should remain same but problem is that i have to select image again from my pc in updation. my scenario is that i just save the name in db not the whole path and hard code the path where ever i need to display the image
here is html
<div class="row">
<label>Image upload</label>
<div class="right"><input type="file" name="file" value="<?php echo $row['images'];?>" /></div>
</div>
here is php
if(($_GET['mod']=='edit') && (isset($_POST['hidden'])))
{
echo $_FILES["file"]["name"];
$allowedExts = array("jpg", "jpeg", "gif", "png");
$extension = end(explode(".", $images));
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/png")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& in_array($extension, $allowedExts))
{
if ($_FILES["file"]["error"] > 0)
{
echo $_FILES["file"]["error"] . "<br>";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"], "upload-images/" . $images);
$update="UPDATE headline SET
headline_title = '$title',
headline_des = '$description',
month = '$month_name',
day = '$day_name',
year = '$year_name',
featured = '$featured',
headline = '$headline',
images = '$images'
where id = ".$_GET['id']."";
$result = mysql_query($update);
}
}