fixed some inconcistancies if an update is required but the record can't be found
This commit is contained in:
@@ -13,6 +13,8 @@ $Source$
|
|||||||
configuration file.
|
configuration file.
|
||||||
* tbl_properties.php3, line 1243: added a param. to enforce reloading of
|
* tbl_properties.php3, line 1243: added a param. to enforce reloading of
|
||||||
the left frame after a flush if $cfgShowTooltip is set to 1.
|
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>
|
2001-10-16 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||||
* lang/*: cleanup thanks to Bj<42>rn T. Hallberg - Removed unused strings
|
* lang/*: cleanup thanks to Bj<42>rn T. Hallberg - Removed unused strings
|
||||||
|
@@ -43,6 +43,10 @@ if (isset($primary_key)) {
|
|||||||
$local_query = 'SELECT * FROM ' . backquote($table) . ' WHERE ' . $primary_key;
|
$local_query = 'SELECT * FROM ' . backquote($table) . ' WHERE ' . $primary_key;
|
||||||
$result = mysql_query($local_query) or mysql_die('', $local_query, '', $err_url);
|
$result = mysql_query($local_query) or mysql_die('', $local_query, '', $err_url);
|
||||||
$row = mysql_fetch_array($result);
|
$row = mysql_fetch_array($result);
|
||||||
|
if (!$row) {
|
||||||
|
unset($row);
|
||||||
|
unset($primary_key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -140,10 +144,6 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
|||||||
$special_chars = htmlspecialchars($row[$field]);
|
$special_chars = htmlspecialchars($row[$field]);
|
||||||
$data = $row[$field];
|
$data = $row[$field];
|
||||||
$backup_field = '<input type="hidden" name="fields_prev[' . urlencode($field) . ']" value="' . urlencode($data) . '" />';
|
$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 {
|
} else {
|
||||||
// loic1: display default values
|
// loic1: display default values
|
||||||
if (!isset($row_table_def['Default'])) {
|
if (!isset($row_table_def['Default'])) {
|
||||||
|
Reference in New Issue
Block a user