cleanup
This commit is contained in:
@@ -1168,10 +1168,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
||||
// 2. Displays the rows' values
|
||||
for ($i = 0; $i < $fields_cnt; ++$i) {
|
||||
$meta = $fields_meta[$i];
|
||||
// loic1: To fix bug #474943 under php4, the row pointer will
|
||||
// depend on whether the "is_null" php4 function is
|
||||
// available or not
|
||||
$pointer = (function_exists('is_null') ? $i : $meta->name);
|
||||
$pointer = $i;
|
||||
// garvin: See if this column should get highlight because it's used in the
|
||||
// where-query.
|
||||
if (isset($highlight_columns) && (isset($highlight_columns[$meta->name]) || isset($highlight_columns[PMA_backquote($meta->name)]))) {
|
||||
@@ -1239,7 +1236,6 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
||||
// with self-join queries, for example), using $meta->name
|
||||
// will show both fields NULL even if only one is NULL,
|
||||
// so use the $pointer
|
||||
// (works only if function_exists('is_null')
|
||||
// PS: why not always work with the number ($i), since
|
||||
// the default second parameter of
|
||||
// mysql_fetch_array() is MYSQL_BOTH, so we always get
|
||||
|
@@ -399,15 +399,11 @@ foreach ($rows as $row_id => $vrow) {
|
||||
|
||||
if ($field['Type'] == 'datetime'
|
||||
&& ! isset($field['Default'])
|
||||
&& ! is_null($field['Default'])) {
|
||||
// INSERT case
|
||||
if ($insert_mode) {
|
||||
$vrow[$field['Field']] = date('Y-m-d H:i:s', time());
|
||||
}
|
||||
// UPDATE case with an empty and not NULL value under PHP4
|
||||
elseif (empty($vrow[$field['Field']]) && is_null($vrow[$field['Field']])) {
|
||||
$vrow[$field['Field']] = date('Y-m-d H:i:s', time());
|
||||
} // end if... elseif...
|
||||
&& ! is_null($field['Default'])
|
||||
&& ($insert_mode || ! isset($vrow[$field['Field']]))) {
|
||||
// INSERT case or
|
||||
// UPDATE case with an NULL value
|
||||
$vrow[$field['Field']] = date('Y-m-d H:i:s', time());
|
||||
}
|
||||
?>
|
||||
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
|
||||
|
Reference in New Issue
Block a user