diff --git a/ChangeLog b/ChangeLog index adfed1fb1..ce1181958 100755 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ $Source$ configuration file. * tbl_properties.php3, line 1243: added a param. to enforce reloading of the left frame after a flush if $cfgShowTooltip is set to 1. + * tbl_change.php3: fixed some inconcistancies if an update is required but + the record can't be found. 2001-10-16 Loïc Chapeaux * lang/*: cleanup thanks to Björn T. Hallberg - Removed unused strings diff --git a/tbl_change.php3 b/tbl_change.php3 index a2260ee74..9dc76a2b1 100755 --- a/tbl_change.php3 +++ b/tbl_change.php3 @@ -43,6 +43,10 @@ if (isset($primary_key)) { $local_query = 'SELECT * FROM ' . backquote($table) . ' WHERE ' . $primary_key; $result = mysql_query($local_query) or mysql_die('', $local_query, '', $err_url); $row = mysql_fetch_array($result); + if (!$row) { + unset($row); + unset($primary_key); + } } else { @@ -140,10 +144,6 @@ for ($i = 0; $i < $fields_cnt; $i++) { $special_chars = htmlspecialchars($row[$field]); $data = $row[$field]; $backup_field = ''; - } else if (isset($primary_key)) { - $special_chars = 'NULL'; - $data = ''; - $backup_field = ''; } else { // loic1: display default values if (!isset($row_table_def['Default'])) {