Medyman
01-04-2008, 12:07 AM
Hi all...
I'm constructing a backend in which I have a few file inputs that are uploading files to the server space + saving the filename in MySQL.
Elsewhere in the CMS, I have a set of forms set to update perviously entered sets of data (which include the images).
When I'd like to update other information in the set (i.e. change something besides the images) and save the info back to the MySQL or update it in this case, I lose the entries I had for the image filenames.
The reason is obvoius...b/c I'm updating the data with blank file inputs.
Now, since there is no value attribute for file inputs, how can I make it so that the image data isn't updated in my query unless it has been changed (i.e. it's not blank).
Here's the PHP that I have
$upd = "INSERT INTO $page (id, category, thumbnail, banner, credits, title, author, bio, summary, article, feature, pictured) VALUES ('', '$category', '$thumbnail', '$banner', '$credits', '$title', '$author', '$bio', '$summary', '$article' , '$feature', '$pictured')";
Bascially, thumbnail & banner are filenames from a file inputs.
I'm constructing a backend in which I have a few file inputs that are uploading files to the server space + saving the filename in MySQL.
Elsewhere in the CMS, I have a set of forms set to update perviously entered sets of data (which include the images).
When I'd like to update other information in the set (i.e. change something besides the images) and save the info back to the MySQL or update it in this case, I lose the entries I had for the image filenames.
The reason is obvoius...b/c I'm updating the data with blank file inputs.
Now, since there is no value attribute for file inputs, how can I make it so that the image data isn't updated in my query unless it has been changed (i.e. it's not blank).
Here's the PHP that I have
$upd = "INSERT INTO $page (id, category, thumbnail, banner, credits, title, author, bio, summary, article, feature, pictured) VALUES ('', '$category', '$thumbnail', '$banner', '$credits', '$title', '$author', '$bio', '$summary', '$article' , '$feature', '$pictured')";
Bascially, thumbnail & banner are filenames from a file inputs.