set the default function to "NOW()" for timestamp fields only in insert mode (ie not in update mode)

This commit is contained in:
Loïc Chapeaux
2001-11-20 15:54:01 +00:00
parent 7feaf78e91
commit 41e32b0cdc

View File

@@ -143,8 +143,9 @@ echo "\n";
</tr> </tr>
<?php <?php
// Set if we passed the first timestamp field // Set if we passed the first timestamp field (loic1: in insert mode only -not
$timestamp_seen = 0; // in edit mode-)
$timestamp_seen = (isset($primary_key) ? 1 : 0);
$fields_cnt = mysql_num_rows($table_def); $fields_cnt = mysql_num_rows($table_def);
for ($i = 0; $i < $fields_cnt; $i++) { for ($i = 0; $i < $fields_cnt; $i++) {
@@ -193,7 +194,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
<?php <?php
echo "\n"; echo "\n";
// The function column // Prepares the field value
if (isset($row) && isset($row[$field])) { if (isset($row) && isset($row[$field])) {
// loic1: special binary "characters" // loic1: special binary "characters"
if ($is_binary || $is_blob) { if ($is_binary || $is_blob) {
@@ -220,6 +221,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
$backup_field = ''; $backup_field = '';
} }
// The function column
// Change by Bernard M. Piller <bernard@bmpsystems.com> // Change by Bernard M. Piller <bernard@bmpsystems.com>
// We don't want binary data to be destroyed // We don't want binary data to be destroyed
// Note: from the MySQL manual: "BINARY doesn't affect how the column is // Note: from the MySQL manual: "BINARY doesn't affect how the column is