Re: auto update mysql table with the current date & time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Gawie Marais" <gmlists@xxxxxxxxx> wrote in message
news:20040614082510.88150.qmail@xxxxxxxxxxxxxxx
> hi guys,
>
> me again ! i need to update a record in a mysql table. now i have defined
a
> datetime field when a record is modified... i want to 'auto update' that
> field whenever a record is modified... what would the php script be for
> something like that... ?

Hi Gawie,

you have to use the timestamp column type for auto-updates. Set the default
to NULL and it will be set/updated when you insert or update a record.

See here:
http://dev.mysql.com/doc/mysql/en/TIMESTAMP_pre-4.1.html

Hope this helps.

Torsten

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux