Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9227971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:12:38+00:00 2026-06-18T05:12:38+00:00

in this edit file i have to choose the same picture file or another

  • 0

in this edit file i have to choose the same picture file or another picture file to be able update the rows. but i want to be able to change whichever i want without touching the other rows. any ideas over here?

<?php

include ("../header.php");
include ("../header2.php");

?>
<?php
include('../config.php');
include ('../ac.thumbs.php');

 if ($_GET['sil']) {
    $sil = htmlspecialchars(stripslashes($_GET['sil']));

    mysql_query("DELETE FROM CloseOut WHERE itemNO = $sil limit 1");
    echo "<h1>$sil item nolu kayit silinmistir</h1><br>";
}

    $edit = htmlspecialchars(stripslashes($_GET['edit']));
    //Resimlerin yuklenecegin yer
 $target = "../../upload/";  
 //////////////////////////////////////////////////////////////////////
 ///////////////////////////////Resim1/////////////////////////////////
 //////////////////////////////////////////////////////////////////////
 $target1 = $target . basename( $_FILES['resim1']['name']) ; 
 //Formdan gelen bilgileri almasi icin
 $resim=($_FILES['resim1']['name']); 
 $isim=$_POST['isim1']; 
 $alan1=$_POST['alan11']; 
 $alan2=$_POST['alan21']; 
 $alan3=$_POST['alan31']; 
 $alan4=$_POST['alan41']; 



/////////////Formdaki bos alanlara bos bilgi kayit etmemesi icin////////////////////////

$updates = array();
if (!empty($resim))
  $updates[] = 'resim="'.mysql_real_escape_string($resim).'"';
if (!empty($isim))
  $updates[] = 'isim="'.mysql_real_escape_string($isim).'"';
if (!empty($alan1))
  $updates[] = 'alan1="'.mysql_real_escape_string($alan1).'"';
if (!empty($alan2))
  $updates[] = 'alan2="'.mysql_real_escape_string($alan2).'"';
if (!empty($alan3))
  $updates[] = 'alan3="'.mysql_real_escape_string($alan3).'"';
if (!empty($alan4))
  $updates[] = 'alan4="'.mysql_real_escape_string($alan4).'"';
$updates = implode(', ', $updates);


/////////////////////////////////////////////////////////////////////////////////////////
 //update etmesi icin
if(move_uploaded_file($_FILES['resim1']['tmp_name'], $target1)) 
{   
mysql_query("UPDATE CloseOut SET $updates WHERE itemNO='$edit' ");
echo "Tebrikler, ". basename( $_FILES['resim1']['name']). " isimli dosya yuklendi ve database'e basariyla islendi!<br>"; 
 } 




 $data = mysql_query("SELECT * FROM CloseOut WHERE itemNO=$edit") or die(mysql_error()); 

 //Puts it into an array 
 while($info = mysql_fetch_array( $data )) 
 { echo "
<center>
<a href=\"edit.php?sil=$info[itemNO]\"onclick=\"return confirm('Do you really want to erase this entry?')\">[ Delete ]</a><br>
<a href=../../large.php?f=upload/".$info['resim'], $thumblarge .">
<img src=../../small.php?f=upload/".$info['resim'], $thumbsmall .">
</a>";
$editresim = $info[resim];
$editisim = $info[isim];
$editalan1 = $info[alan1];
$editalan2 = $info[alan2];
$editalan3 = $info[alan3];
$editalan4 = $info[alan4];
} 


?>

<br>
<center> 
<table width="900" border="5" style="background-color:white; "bordercolor="#000000">
    <tr>
        <td width="120" height="50" bgcolor= "545454"><b>RESIM</b></td>
        <td width="120" height="50" bgcolor= "545454"><b>NAME</b></td>
        <td width="120" height="50" bgcolor= "545454"><b>CATAGORY</b></td>
        <td width="120" height="50" bgcolor= "545454"><b>QUANTITY</b></td>
        <td width="120" height="50" bgcolor= "545454"><b>LOCATION</b></td>
        <td width="120" height="50" bgcolor= "545454"><b>PRICE</b></td>
    </tr>
    <tr>
<form enctype="multipart/form-data" method="post" action="">
<td><input type="file" name="resim1" value="<?php echo $editresim;?>"> </td>
<td><input type="text" name="isim1" value="<?php echo $editisim;?>"> </td>
<td><input type="text" name="alan11" value="<?php echo $editalan1;?>"> </td>
<td><input type="text" name="alan21" value="<?php echo $editalan2;?>">  </td>
<td><input type="text" name="alan31" value="<?php echo $editalan3;?>"></td>
<td><input type="text" name="alan41" value="<?php echo $editalan4;?>"></td>
</tr>

<td colspan="6"><center><input type="submit"></center></td>


</form>
</table>
</center>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:12:40+00:00Added an answer on June 18, 2026 at 5:12 am

    Look at this code:

    if(move_uploaded_file($_FILES['resim1']['tmp_name'], $target1)) 
    {   
        mysql_query("UPDATE CloseOut SET $updates WHERE itemNO='$edit' ");
        echo "Tebrikler, ". basename( $_FILES['resim1']['name']). " isimli dosya yuklendi ve database'e basariyla islendi!<br>"; 
    }
    

    If you don’t upload anything, then move_uploaded_file is going to return false and your update will never happen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been told to edit this file in Sharepoint Designer: /_layouts/KWizCom_WikiPlus/CreateNew.aspx I found
EDIT i have something like this in a file: imagecolor=0 arrayimagecolorcopy=0 arrayimagecolorcopy3d=0 when i
I have got a choose file in my applescript. How do I change the
I have this application from the market in an apk format, but I want
EDIT: This post was originally specific to ASP.NET, but after thinking about it I'm
I have a sample xml file that looks like this: <Books> <Category Genre=Fiction BookName=book_name
I have this problem. I want to add image to listView. Exactly I want
I want to create file-links to open an external editor from firefox. I have
Ryan Bates' nifty_scaffolding, for example, does this edit.html.erb <%= render :partial => 'form' %>
Edit: This problem was down to me passing the wrong view to the Touch

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.