Possible Duplicate:
PHP image replacement?
I’m writing an edit script that allows a row to be updated in the database.
It starts by importing that row, then I wrap input boxes around the text areas which can be edited and updated.
That works great.
There are two url’s stored in the database, http://www.mysite.com/images/image1.jpg and http://www.mysite.com/images/image2.jpg
What’s the best way of checking if there are no new uploaded images on the edit form, to NOT update this field in the database?
I’ve tried using:
if ($image1new !="") { $image1==$image1new; } else { $image1 = $_POST['image1'];}
if ($image2new !="") { $image2==$image2new; } else { $image2 = $_POST['image2'];}
But that always passes a blank string?
Use
$image1 = $image1new;instead of$image1 == $image1new;. You should use just a single=when you want to assign a value to a variable