I have posted image in database, and i got that image also, but i want to replace the image using php code can any one help me this is my code

$id =$_REQUEST['id'];

$result = mysql_query("SELECT * FROM doctors WHERE id  = '$id'");
$test = mysql_fetch_array($result);
if (!$result) 

        die("Error: Data not found..");
                 $name=$test['doc_name'] ;
$hospital=$test['hosp_name'] ;
$facilities=$test['hosp_facilities'] ;
$mobile=$test['doc_mobileno'] ;
$email=$test['doc_emailid'] ;
$address=$test['doc_address'] ;
$Speciality=$test['speciality'] ;
$city=$test['doc_city'] ;
$map=$test['doc_iframe'] ;

    $name_save = $_POST['doc_name'];
    $hospital_save = $_POST['hosp_name'];
    $description_save = $_POST['hosp_desc'];

    $facilities_save = $_POST['hosp_facilities'];
    $mobile_save = $_POST['doc_mobileno'];

    $email_save = $_POST['doc_emailid'];
    $address_save = $_POST['doc_address'];
    $Speciality_save = $_POST['speciality'];
    $city_save = $_POST['doc_city'];
    $map_save = $_POST['doc_iframe'];

    mysql_query("UPDATE doctors SET doc_name ='$name_save', hosp_name ='$hospital_save',
        hosp_desc ='$description_save',hosp_facilities='$facilities_save',doc_mobileno='$mobile_save',
        WHERE id = '$id'")
                or die(mysql_error()); 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>

<form method="post">
        <td><input type="text" name="doc_name" value="<?php echo $name ?>"/></td>
        <td>Hospital Name</td>
        <td><input type="text" name="hosp_name" value="<?php echo $hospital ?>"/></td>
        <td><input type="text" name="hosp_desc" value="<?php echo $description ?>"/></td>
        <td><input type="text" name="hosp_facilities" value="<?php echo $facilities ?>"/></td>
        <td>Hospital Phone Number</td>
        <td><input type="text" name="doc_mobileno" value="<?php echo $mobile ?>"/></td>
        <td><input type="text" name="doc_emailid" value="<?php echo $email ?>"/></td>
        <td>Hospital Address</td>
        <td><input type="text" name="doc_address" value="<?php echo $address ?>"/></td>
        <td><input type="text" name="speciality" value="<?php echo $Speciality ?>"/></td>
        <td><input type="text" name="doc_city" value="<?php echo $city ?>"/></td>
        <td><input type="text" name="doc_iframe" value="<?php echo $map ?>"/></td>
        <td><input type="file" name="hosp_pic" value=""/><?php echo $img ?></td>
        <td> </td>
        <td><input type="submit" name="save" value="save" /></td>


one more doubt have
username and password is in one table and the role in other table.
in login page i will enter username and password, dependent on that it should check for role, if role is differt link for diffrent pages.

can you please send me the example code