set with no field selected

This commit is contained in:
Marc Delisle
2001-08-07 00:11:09 +00:00
parent bfbab21e0b
commit f32311b9f0
2 changed files with 9 additions and 6 deletions

View File

@@ -10,6 +10,8 @@ $Source$
when displaying a TEXT field when displaying a TEXT field
* sql.php3, bug 448226 (Missing MySQL messages), correction from Loic. * sql.php3, bug 448226 (Missing MySQL messages), correction from Loic.
* tbl_change.php3, bug 442778, Edit record with two similar SET fields * tbl_change.php3, bug 442778, Edit record with two similar SET fields
* tbl_replace.php3, could not save a row with a set which has no
value selected
2001-08-06 Steve Alberty <alberty@nepunlabs.de> 2001-08-06 Steve Alberty <alberty@nepunlabs.de>
* index.php3: remove warning under Apache 2.0.23-dev * index.php3: remove warning under Apache 2.0.23-dev

View File

@@ -8,7 +8,6 @@
require('./grab_globals.inc.php3'); require('./grab_globals.inc.php3');
require('./lib.inc.php3'); require('./lib.inc.php3');
/** /**
* Initializes some variables * Initializes some variables
*/ */
@@ -90,14 +89,16 @@ if (isset($primary_key) && ($submit_type != $strInsertAsNewRow)) {
break; break;
} // end switch } // end switch
if (empty($funcs[$key])) { if (!empty($val)) {
$valuelist .= backquote($key) . ' = ' . $val . ', '; if (empty($funcs[$key])) {
} else { $valuelist .= backquote($key) . ' = ' . $val . ', ';
$valuelist .= backquote($key) . " = $funcs[$key]($val), "; } else {
$valuelist .= backquote($key) . " = $funcs[$key]($val), ";
}
} }
} // end while } // end while
// Builds the sql upate query // Builds the sql update query
$valuelist = ereg_replace(', $', '', $valuelist); $valuelist = ereg_replace(', $', '', $valuelist);
$query = 'UPDATE ' . backquote($table) . " SET $valuelist WHERE $primary_key"; $query = 'UPDATE ' . backquote($table) . " SET $valuelist WHERE $primary_key";
} // end row update } // end row update