file uploading work successfully but now i want to replace the existing url with a new url how can i will do?
<p>File uploading work successfully but now I want to replace the existing url with a new url how can I do that?</p>

<p>This is my code</p>

<pre><code>&lt;?php
$output = array();
$valid_formats = array("jpg", "png", "gif", "bmp", "jpeg", "JPG", "PNG");

if(!file_exists($kdzImgDir . "/kdz-uploads")){
    mkdir($kdzImgDir . "/kdz-uploads");
}
$path = $kdzImgDir . "/kdz-uploads/";
$i=0;
foreach($_FILES as $data){
    $name = $data['name'];
    $size = $data['size'];
    $tmp = $data['tmp_name'];

    $image_info =  getimagesize($tmp);
    $width = $image_info[0];
    $height = $image_info[1];

    if(strlen($name)){
        list($old_name, $ext) = explode(".", $name);
        if(in_array($ext,$valid_formats)){
            //if($size&lt;(1024*1024)){
                $actual_image_name = time().substr(str_replace(" ", "_", $old_name), 5).$i.".".$ext;
                $thumb_name = "thumb_".$actual_image_name;
                if(move_uploaded_file($tmp, $path.$actual_image_name)){
                  $wpdb-&gt;insert("share_images",
                    array(
                        "url" =&gt; $actual_image_name,
                        "page_id" =&gt; $pid
                    ),
                    array('%s','%s')
                ); 
                }
                else $output["error"] = "move failed";
            //}
            //else $output["error"] = "Image file size max 1 MB";
        }
        else $output["error"] = "Invalid file format..";
    }
    else $output["error"] = "Please select image..!";
    $i++;
}

?&gt;
</code></pre>

<p>Here is my fetching and showing url code:</p>

<pre><code>&lt;?php           
 $imgFile = stripslashes_deep($wpdb-&gt;get_results("SELECT * FROM `share_images` WHERE page_id = '".$pid."'", ARRAY_A));
?&gt;
 &lt;h5 class="heading"&gt;Please Upload Your Share Image:&lt;/h5&gt;
  &lt;div class="row-fluid"&gt;

  &lt;?php
/*  echo "&lt;pre&gt;";
    print_r($imgFile);
    echo "&lt;br&gt;";
    */
    for($i=0; $i&lt;5; $i++){
        if($imgFile[$i]['url']){
  ?&gt;               
    &lt;div class="span4"&gt;
    &lt;input type="hidden" value="&lt;?php echo $imgFile[$i]['url']; ?&gt;" /&gt;
        &lt;div data-provides="fileupload" class="fileupload fileupload-new" data-name="shImgFrst"&gt;&lt;input type="hidden"&gt;
           &lt;div style="width: 200px; height: 150px;" class="fileupload-new thumbnail"&gt;&lt;img src="&lt;?php echo $kdzImgUrl.$imgFile[$i]['url']; ?&gt;" /&gt;&lt;/div&gt;
            &lt;div style="max-width: 200px; max-height: 150px; line-height: 0px;" class="fileupload-preview fileupload-exists thumbnail"&gt;&lt;/div&gt;
            &lt;div&gt;
                &lt;span class="btn btn-file"&gt;&lt;span class="fileupload-new"&gt;Select image&lt;/span&gt;&lt;span class="fileupload-exists"&gt;Change&lt;/span&gt;&lt;input type="file" /&gt;&lt;/span&gt;
                &lt;a data-dismiss="fileupload" class="btn fileupload-exists" href="#"&gt;Remove&lt;/a&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;&lt;!--end of span4--&gt;
    &lt;?php 
        }
        else {?&gt;
      &lt;div class="span4"&gt;
            &lt;div data-provides="fileupload" class="fileupload fileupload-new"&gt;&lt;input type="hidden"&gt;
                &lt;div style="width: 200px; height: 150px;" class="fileupload-new thumbnail"&gt;&lt;img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;amp;text=no+image" alt="" /&gt;&lt;/div&gt;
                &lt;div style="max-width: 200px; max-height: 150px; line-height: 0px;" class="fileupload-preview fileupload-exists thumbnail"&gt;&lt;/div&gt;
                &lt;div&gt;
                    &lt;span class="btn btn-file"&gt;&lt;span class="fileupload-new"&gt;Select image&lt;/span&gt;&lt;span class="fileupload-exists"&gt;Change&lt;/span&gt;&lt;input type="file" /&gt;&lt;/span&gt;
                    &lt;a data-dismiss="fileupload" class="btn fileupload-exists" href="#"&gt;Remove&lt;/a&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;?php
    }
    }
  ?&gt;
            &lt;/div&gt;&lt;!--end of row fluid --&gt;
        &lt;/div&gt;&lt;!--Accordian inner --&gt;
    &lt;/div&gt;&lt;!--Accordian Body --&gt;
&lt;/div&gt;&lt;!--Accordian Group --&gt;
</code></pre>
