Platon Technologies
neprihlásený Prihlásiť Registrácia
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Utorok, 16. júl 2024
O nás
Otvorený softvér
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  CURRENT_TIMESTAMP puts in all zeros on a timestamp.

phpMyEdit Installation     CURRENT_TIMESTAMP puts in all zeros on a timestamp.
Odoslať novú tému   Odpovedať na tému    
Android8675     Založený: 08.11.2011   Príspevky: 2  
Príspevok Zaslal: 2011-11-08 23:20
Návrat hore  Odpovedať s citátom     

* This file was generated by:
*                    phpMyEdit version: 5.7.1
*       phpMyEdit.class.php core class: 1.215
*            phpMyEditSetup.php script: 1.50
*              generating setup script: 1.50

So trying to get a timestamp to update on a dB, whenever I Add a record, the timestamp reads "CURRENT_TIMESTAMP" greyed out, and when the record is entered the timestamp is 0000-00-00 00:00:00

the key and sort_field is set to the timestamp field (ts).

the table .php file has the following for the timestamp field:

$opts['fdd']['ts'] = array(
  'name'     => 'Time',
  'select'   => 'T',
  'options'  => 'LFAVCPDR', // updated automatically (MySQL feature)
  'maxlen'   => 19,
  'default'  => 'CURRENT_TIMESTAMP',
  'sort'     => true

myphpadmin reports the field as:


#   Column   Type      Null   Default
2   ts   timestamp  No   CURRENT_TIMESTAMP

Running MySQL 5.5.16

Any help appreciated.

doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2011-11-09 19:02
Návrat hore  Odpovedať s citátom     

When you export the schema using phpMyAdmin, if it reads as `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, then
MySQL will manage the timestamp without intervention from the script, and thus probably set VLF as the only options. The following is probably all you'll need, assuming you do not have plans to manually modify the timestamp.

$opts['fdd']['ts'] = array(
  'name'     => 'Time',
  'select'   => 'T',
  'options'  => 'VLF',
  'sort'     => true

Android8675     Založený: 08.11.2011   Príspevky: 2  
Príspevok Zaslal: 2011-11-15 18:16
Návrat hore  Odpovedať s citátom     

yeah, I want the time stamp to mark when the entry was made. I don't want it to update every time the record is modified. after a lot of google digging I found a fix that seems to work. The trick is to not display the time stamp in the form. That seems to save the time stamp correctly.

$opts['fdd']['ts'] = array(
//  'colattrs|LF'   => '',
//  'css'        => array('postfix' => 'right-justify'),
  'default'    => 'CURRENT_TIMESTAMP',
  'help|ACP'   => 'Timestamp',
  'input'      => 'R',
  'maxlen'     => 19,
  'name'       => 'Time Stamp',
  'options'    => 'LFCVD',
  'select'     => 'T',
  'size|ACP'   => 19,
  'sqlw'       => 'TRIM("$val_as")',
  'sort'       => true

No idea how much of that it really needed, but it seems to save the timestamp now as it should.

Suggestions welcome.

CooperHassell     Založený: 27.03.2020   Príspevky: 1  
Príspevok Zaslal: 2020-03-27 08:10
Návrat hore  Odpovedať s citátom     

There are many programmers who need help during his project because they having a problem and get an error and they dont know what to do. Therefore I have shared the list here you can get whole information here.

denisbeta     Založený: 25.08.2023   Príspevky: 2208  
Príspevok Zaslal: 2023-09-01 19:05
Návrat hore  Odpovedať s citátom

Diatea [ME]

Hypertea [RS]

Nautubone [ME]

Hemomax tea [ME]

Herbolo [ME] emalecallgirls
https: //



Prostatricum PLUS [IT]

Slim tea Plus

Elsie [TH]


Sundos [TH] 2

Power Shape [AT]

Deeper [TH]

Prostate Pure [BA]

Noktal [BA]

Dianorm [BA]

Parazol [RS]

Dia drops [RS]

Prostamid [RS]

Verakose [TH]


Nutrivitex [ID]

Prostamal [BA]

Hemoren [RS]

Noktal [ME]

Hyper Active [BA]

Dia Active [BA]

O caps [ME]

Prostamid [ME]

Hypertea [ME]



Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov