Default to now when no starttime is given
authorJoey Schulze <joey@infodrom.org>
Wed, 16 Nov 2005 19:19:34 +0000 (19:19 +0000)
committerJoey Schulze <joey@infodrom.org>
Wed, 16 Nov 2005 19:19:34 +0000 (19:19 +0000)
src/InfoCon/hwdb/update.wml

index 44560f6..affb520 100644 (file)
@@ -77,6 +77,9 @@
                         $id);
         $sth = pg_exec ($dbh, $query) or die_query("Cannot update the database!", $query);
       } else {
+        if (!isset($starttime)) {
+         $starttime = 'now()';
+       }
        $query = sprintf ("INSERT INTO component (name,serno,starttime,endtime,owner,hwtype,price,status,comment) "
                         ."VALUES ('%s','%s','%s',%s,%d,%d,%s,'%s','%s')",
                         addslashes ($name),