$primary_key); } $row = array(); $result = array(); foreach ($primary_key_array AS $rowcount => $primary_key) { $local_query = 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE ' . $primary_key . ';'; $result[$rowcount] = PMA_DBI_query($local_query, NULL, PMA_DBI_QUERY_STORE); $row[$rowcount] = PMA_DBI_fetch_assoc($result[$rowcount]); $primary_keys[$rowcount] = $primary_key; // No row returned if (!$row[$rowcount]) { unset($row[$rowcount]); unset($primary_key_array[$rowcount]); $goto_cpy = $goto; $goto = 'tbl_properties.php?' . PMA_generate_common_url($db, $table) . '&$show_query=1' . '&sql_query=' . urlencode($local_query); if (isset($sql_query)) { $sql_query_cpy = $sql_query; unset($sql_query); } $sql_query = $local_query; PMA_showMessage($strEmptyResultSet); $goto = $goto_cpy; unset($goto_cpy); if (isset($sql_query_cpy)) { $sql_query = $sql_query_cpy; unset($sql_query_cpy); } echo "\n"; require_once('./footer.inc.php'); } // end if (no record returned) } } else { $result = PMA_DBI_query('SELECT * FROM ' . PMA_backquote($table) . ' LIMIT 1;', NULL, PMA_DBI_QUERY_STORE); unset($row); } // // retrieve keys into foreign fields, if any $cfgRelation = PMA_getRelationsParam(); $foreigners = ($cfgRelation['relwork'] ? PMA_getForeigners($db, $table) : FALSE); /** * Displays the form */ // loic1: autocomplete feature of IE kills the "onchange" event handler and it // must be replaced by the "onpropertychange" one in this case $chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5) ? 'onpropertychange' : 'onchange'; // Had to put the URI because when hosted on an https server, // some browsers send wrongly this form to the http server. ?>
> '; } else { $iconic_spacer = ''; } $titles['Browse'] = $iconic_spacer . '' . $strBrowseForeignValues . ''; if ($propicon == 'both') { $titles['Browse'] .= ' ' . $strBrowseForeignValues . ''; } } else { $titles['Browse'] = $strBrowseForeignValues; } // Set if we passed the first timestamp field $timestamp_seen = 0; $fields_cnt = PMA_DBI_num_rows($table_def); // Set a flag here because the 'if' would not be valid in the loop // if we set a value in some field $insert_mode = (!isset($row) ? TRUE : FALSE); if ($insert_mode) { $loop_array = array(); for ($i = 0; $i < $cfg['InsertRows']; $i++) $loop_array[] = FALSE; } else { $loop_array = $row; } while ($trow = PMA_DBI_fetch_assoc($table_def)) { $trow_table_def[] = $trow; } $tabindex = 0; $tabindex_for_function = +1000; $tabindex_for_null = +2000; $tabindex_for_value = 0; $o_rows = 0; foreach ($loop_array AS $vrowcount => $vrow) { if ($vrow === FALSE) { unset($vrow); } if ($insert_mode) { $jsvkey = $vrowcount; $browse_foreigners_uri = '&pk=' . $vrowcount; } else { $jsvkey = urlencode($primary_keys[$vrowcount]); $browse_foreigners_uri = '&pk=' . urlencode($primary_keys[$vrowcount]); } $vkey = '[multi_edit][' . $jsvkey . ']'; $vresult = (isset($result) && is_array($result) && isset($result[$vrowcount]) ? $result[$vrowcount] : $result); if ($insert_mode && $vrowcount > 0) { echo ''; echo '
' . "\n"; } ?> ' . $strFunction . '' . "\n"; } ?> and instead, // but it didn't worked because of the ) if ((($o_rows * $fields_cnt + $i) % 15 == 0) && ($i + $o_rows != 0)) { ?> d [Type] => datetime [Null] => YES [Key] => [Extra] => [True_Type] => datetime ) // but, look what we get if we switch to iso: (Default is NULL) // Array ( [Field] => d [Type] => datetime [Null] => YES [Key] => [Default] => [Extra] => [True_Type] => datetime ) // so I force a NULL into it (I don't think it's possible // to have an empty default value for DATETIME) // then, the "if" after this one will work if ($row_table_def['Type'] == 'datetime' && !isset($row_table_def['Default']) && isset($row_table_def['Null']) && $row_table_def['Null'] == 'YES') { $row_table_def['Default'] = NULL; } if ($row_table_def['Type'] == 'datetime' && (!isset($row_table_def['Default'])) && (!is_null($row_table_def['Default']))) { // INSERT case if ($insert_mode) { if (isset($vrow)) { $vrow[$rowfield] = date('Y-m-d H:i:s', time()); } else { $vrow = array($rowfield => date('Y-m-d H:i:s', time())); } } // UPDATE case with an empty and not NULL value under PHP4 else if (empty($vrow[$rowfield]) && is_null($vrow[$rowfield])) { $vrow[$rowfield] = date('Y-m-d H:i:s', time()); } // end if... else if... } $len = (preg_match('@float|double@', $row_table_def['Type'])) ? 100 : PMA_DBI_field_len($vresult, $i); $first_timestamp = 0; $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?> '; } else { // loic1: display default values if (!isset($row_table_def['Default'])) { $row_table_def['Default'] = ''; $real_null_value = TRUE; $data = ''; } else { $data = $row_table_def['Default']; } $special_chars = htmlspecialchars($row_table_def['Default']); $backup_field = ''; } $idindex = ($o_rows * $fields_cnt) + $i + 1; $tabindex = (($idindex - 1) * 3) + 1; // The function column // ------------------- // Change by Bernard M. Piller // We don't want binary data to be destroyed // Note: from the MySQL manual: "BINARY doesn't affect how the column is // stored or retrieved" so it does not mean that the contents is // binary if ($cfg['ShowFunctionFields']) { if (($cfg['ProtectBinary'] && $is_blob) || ($cfg['ProtectBinary'] == 'all' && $is_binary)) { echo ' ' . "\n"; } else if (strstr($row_table_def['True_Type'], 'enum') || strstr($row_table_def['True_Type'], 'set')) { echo ' ' . "\n"; } else { ?> ' . "\n"; if (!(($cfg['ProtectBinary'] && $is_blob) || ($cfg['ProtectBinary'] == 'all' && $is_binary)) && $row_table_def['Null'] == 'YES') { echo ' 20) { $onclick .= '1, '; } else { $onclick .= '2, '; } } else if (strstr($row_table_def['True_Type'], 'set')) { $onclick .= '3, '; } else if ($foreigners && isset($foreigners[$field])) { $onclick .= '4, '; } else { $onclick .= '5, '; } $onclick .= '\'' . urlencode($field) . '\', \'' . md5($field) . '\', \'' . $vkey . '\'); this.checked = true}; return true" />' . "\n"; echo $onclick; } else { echo '  ' . "\n"; } echo ' ' . "\n"; // The value column (depends on type) // ---------------- require('./libraries/get_foreign.lib.php'); if (isset($foreign_link) && $foreign_link == true) { ?> 32000) { echo ' ' . "\n"; } } else if ($type == 'enum') { $enum = PMA_getEnumSetOptions($row_table_def['Type']); $enum_cnt = count($enum); ?> // We don't want binary data destroyed else if ($is_binary || $is_blob) { if (($cfg['ProtectBinary'] && $is_blob) || ($cfg['ProtectBinary'] == 'all' && $is_binary)) { echo "\n"; ?> '; } // end else if ( binary or blob) else { // For char or varchar, respect the maximum length (M); for other // types (int or float), the length is not a limit on the values that // can be entered, so let's be generous (20) (we could also use the // real limits for each numeric type) // 2004-04-07, it turned out that 20 was not generous enough // for the maxlength if ($is_char) { $fieldsize = (($len > 40) ? 40 : $len); $maxlength = $len; } else { $fieldsize = 20; $maxlength = 99; } // end if... else... echo "\n"; ?>
'; } // end foreach on multi-edit ?>
 
align="center" bgcolor=""> > ' . $strBinary . '-- ="return unNullify('', '')" tabindex="" id="field__3" value="" />  
' . $strTextAreaLength . ' 20) { echo "\n"; ?> '; echo '' . "\n"; } // end for } // end else echo "\n"; ?> 40) ? 40 : $len); $maxlength = $len; } echo "\n"; ?> ="return unNullify('', '')" tabindex="" id="field__3" />  '; // find maximum upload size, based on field type $max_field_sizes = array( 'tinyblob' => '256', 'blob' => '65536', 'mediumblob' => '16777216', 'longblob' => '4294967296'); // yeah, really $this_field_max_size = $max_upload_size; // from PHP max if ($this_field_max_size > $max_field_sizes[$type]) { $this_field_max_size = $max_field_sizes[$type]; } echo PMA_displayMaximumUploadSize($this_field_max_size) . "\n"; echo ' ' . PMA_generateHiddenMaxFileSize($this_field_max_size) . "\n"; } if (!empty($cfg['UploadDir'])) { if (substr($cfg['UploadDir'], -1) != '/') { $cfg['UploadDir'] .= '/'; } if ($handle = @opendir($cfg['UploadDir'])) { $is_first = 0; while ($file = @readdir($handle)) { if (is_file($cfg['UploadDir'] . $file) && !PMA_checkFileExtensions($file, '.sql')) { if ($is_first == 0) { echo "
\n"; echo ' ' . $strOr . '' . ' ' . $strWebServerUploadDirectory . ':
' . "\n"; echo ' ' . "\n"; } // end if (isfirst > 0) @closedir($handle); } else { echo ' ' . $strError . '
' . "\n"; echo ' ' . $strWebServerUploadDirectoryError . "\n"; } } // end if (web-server upload directory) echo '
="return unNullify('', '')" tabindex="" id="field__3" />

      
   -- --    tabindex="" style="vertical-align: middle" />
      
tabindex="" style="vertical-align: middle" />
      
tabindex="" style="vertical-align: middle" />
      
tabindex="" style="vertical-align: middle" />