I'm having a brain dead moment... If someone could talk this through with me and make suggestions that'd be great.
I'm importing a URL from a database, eg www.mysite.com/images/image1.jpg
set as variable newimage1
This is loaded from the DB and placed on the page.
As this is an edit page, the user can upload a new image.
If the user doesn't upload a new image, but saves the page anyway, the variable newimage1
is not set, it clears the existing image url from the database because the variable is set to ""
.
What's the best way to do this? An if statement, that checks if newimage1
is blank and removes it from the update to the database?
Sorry for this simple question!