//code to replace the uploaded file
$search=mysql_query("SELECT * FROM `case` WHERE id='$h_id'");
$searchrow=mysql_fetch_array($search);
$attach=$searchrow['attachment'];
$image1= addslashes(file_get_contents($_FILES['file']['tmp_name']));
$image_name1= addslashes($_FILES['file']['name']);
move_uploaded_file($_FILES["file"]["tmp_name"], "../client/attachments/".$attach);
//but that replacement is not take place.