- if(file_exists('db_connect.php')) {
- require_once('db_connect.php');
- if($edit_id) {
- db_update('~form_name~', '~db_fields~', ~php_fields~, 'id = %"', $edit_id);
- tem_set('did', 'updated');
+ if(file_exists('db_connect.php') || file_exists('code/db_connect.php')) {
+ if(file_exists('db_connect.php') {
+ require_once('db_connect.php');
+ } else {
+ require_once('code/db_connect.php');
+ }
+ if($edit_id) {<!--~image_db start~-->
+ # uploading nothing means leaving it as is.
+ if(!$~name~ && $delete_~name~ != 'Yes') {
+ $~name~ = db_get_value('~form_name~', '~name~', 'where id=%i', $edit_id);
+ }
+ <!--~end~-->
+ db_update('~form_name~', '~db_fields~', ~php_fields~, 'where id=%i', $edit_id);
+ message('Entry updated.');