fixed some inconcistancies if an update is required but the record can't be found

This commit is contained in:
Loïc Chapeaux
2001-10-17 15:11:44 +00:00
parent f5c9a8991e
commit 3e345622ea
2 changed files with 6 additions and 4 deletions

View File

@@ -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<4C>c Chapeaux <lolo@phpheaven.net>
* lang/*: cleanup thanks to Bj<42>rn T. Hallberg - Removed unused strings

View File

@@ -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 = '<input type="hidden" name="fields_prev[' . urlencode($field) . ']" value="' . urlencode($data) . '" />';
} else if (isset($primary_key)) {
$special_chars = 'NULL';
$data = '';
$backup_field = '<input type="hidden" name="fields_prev[' . urlencode($field) . ']" value="NULL" />';
} else {
// loic1: display default values
if (!isset($row_table_def['Default'])) {