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