Forums

How to updata my database table without changing image field

titonahmed 01 May, 2011
Hi
All. I want to change my text field or with one image filed of 3 images filed. If i update, my another image fields are being emptied/empty. How it possible to keep unchanged that image field i do not change? i need immediately.
GreyHead 04 May, 2011
Hi titonahmed,

I think that you will need to unset the file inputs in the $_POST array if they are empty. Assuming that the input has the name file_1 try this code in the OnSubmit Before Box:
<?php
$file_1 = JRequest::getString('file_1', '', 'post');
if ( !$file_1 ) {
  unset($_POST['file_1']);
}
?>

Bob
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger